/** The priority of messages, sorted from high (0) to low (>0) */ export enum MessagePriority { Nonce = 0 , Controller , MultistepController , Supervision , Ping , WakeUp , Normal , NodeQuery , Poll } export function isMessagePriority ( val ) { return typeof val === "number" && val in MessagePriority ; } /** Indicates the type of a data message */ export enum MessageType { Request = 0x0 , Response = 0x1 } /**
 * Complete list of function IDs for data messages.
 * IDs starting with FUNC_ID are straight from OZW and not implemented here yet.
 * IDs starting with UNKNOWN_FUNC are taken from openhab-zwave and not implemented here yet.
 * IDs starting with UNKNOWN_FUNC are also taken from https://github.com/yepher/RaZBerry/blob/master/README.md and not implemented yet
 * IDs ending with UNKNOWN_<hex-code> are reported by the stick but we don't know what they mean.
 */ export enum FunctionType { GetSerialApiInitData = 0x02 , FUNC_ID_SERIAL_API_APPL_NODE_INFORMATION = 0x03 , ApplicationCommand = 0x04 , GetControllerCapabilities = 0x05 , SetSerialApiTimeouts = 0x06 , GetSerialApiCapabilities = 0x07 , SoftReset = 0x08 , UNKNOWN_FUNC_UNKNOWN_0x09 = 0x09 , SerialAPIStarted = 0x0a , SerialAPISetup = 0x0b , SetRFReceiveMode = 0x10 , UNKNOWN_FUNC_SET_SLEEP_MODE = 0x11 , FUNC_ID_ZW_SEND_NODE_INFORMATION = 0x12 , SendData = 0x13 , SendDataMulticast = 0x14 , GetControllerVersion = 0x15 , SendDataAbort = 0x16 , FUNC_ID_ZW_R_F_POWER_LEVEL_SET = 0x17 , UNKNOWN_FUNC_SEND_DATA_META = 0x18 , FUNC_ID_ZW_GET_RANDOM = 0x1c , GetControllerId = 0x20 , UNKNOWN_FUNC_MEMORY_GET_BYTE = 0x21 , UNKNOWN_FUNC_MEMORY_PUT_BYTE = 0x22 , UNKNOWN_FUNC_MEMORY_GET_BUFFER = 0x23 , UNKNOWN_FUNC_MEMORY_PUT_BUFFER = 0x24 , UNKNOWN_FUNC_FlashAutoProgSet = 0x27 , UNKNOWN_FUNC_UNKNOWN_0x28 = 0x28 , GetNVMId = 0x29 , ExtNVMReadLongBuffer = 0x2a , ExtNVMWriteLongBuffer = 0x2b , ExtNVMReadLongByte = 0x2c , ExtExtWriteLongByte = 0x2d , NVMOperations = 0x2e , UNKNOWN_FUNC_CLOCK_SET = 0x30 , UNKNOWN_FUNC_CLOCK_GET = 0x31 , UNKNOWN_FUNC_CLOCK_COMPARE = 0x32 , UNKNOWN_FUNC_RTC_TIMER_CREATE = 0x33 , UNKNOWN_FUNC_RTC_TIMER_READ = 0x34 , UNKNOWN_FUNC_RTC_TIMER_DELETE = 0x35 , UNKNOWN_FUNC_RTC_TIMER_CALL = 0x36 , UNKNOWN_FUNC_ClearNetworkStats = 0x39 , UNKNOWN_FUNC_GetNetworkStats = 0x3a , GetBackgroundRSSI = 0x3b , UNKNOWN_FUNC_RemoveNodeIdFromNetwork = 0x3f , FUNC_ID_ZW_SET_LEARN_NODE_STATE = 0x40 , GetNodeProtocolInfo = 0x41 , HardReset = 0x42 , FUNC_ID_ZW_NEW_CONTROLLER = 0x43 , FUNC_ID_ZW_REPLICATION_COMMAND_COMPLETE = 0x44 , FUNC_ID_ZW_REPLICATION_SEND_DATA = 0x45 , AssignReturnRoute = 0x46 , DeleteReturnRoute = 0x47 , RequestNodeNeighborUpdate = 0x48 , ApplicationUpdateRequest = 0x49 , AddNodeToNetwork = 0x4a , RemoveNodeFromNetwork = 0x4b , FUNC_ID_ZW_CREATE_NEW_PRIMARY = 0x4c , FUNC_ID_ZW_CONTROLLER_CHANGE = 0x4d , FUNC_ID_ZW_SET_LEARN_MODE = 0x50 , AssignSUCReturnRoute = 0x51 , FUNC_ID_ZW_ENABLE_SUC = 0x52 , FUNC_ID_ZW_REQUEST_NETWORK_UPDATE = 0x53 , SetSUCNodeId = 0x54 , DeleteSUCReturnRoute = 0x55 , GetSUCNodeId = 0x56 , UNKNOWN_FUNC_SEND_SUC_ID = 0x57 , UNKNOWN_FUNC_AssignPrioritySUCReturnRoute = 0x58 , UNKNOWN_FUNC_REDISCOVERY_NEEDED = 0x59 , FUNC_ID_ZW_REQUEST_NODE_NEIGHBOR_UPDATE_OPTIONS = 0x5a , FUNC_ID_ZW_EXPLORE_REQUEST_INCLUSION = 0x5e , RequestNodeInfo = 0x60 , RemoveFailedNode = 0x61 , IsFailedNode = 0x62 , ReplaceFailedNode = 0x63 , UNKNOWN_FUNC_UNKNOWN_0x66 = 0x66 , UNKNOWN_FUNC_UNKNOWN_0x67 = 0x67 , UNKNOWN_FUNC_TIMER_START = 0x70 , UNKNOWN_FUNC_TIMER_RESTART = 0x71 , UNKNOWN_FUNC_TIMER_CANCEL = 0x72 , UNKNOWN_FUNC_TIMER_CALL = 0x73 , UNKNOWN_FUNC_UNKNOWN_0x78 = 0x78 , GetRoutingInfo = 0x80 , UNKNOWN_FUNC_GetTXCounter = 0x81 , UNKNOWN_FUNC_ResetTXCounter = 0x82 , UNKNOWN_FUNC_StoreNodeInfo = 0x83 , UNKNOWN_FUNC_StoreHomeId = 0x84 , UNKNOWN_FUNC_LOCK_ROUTE_RESPONSE = 0x90 , UNKNOWN_FUNC_SEND_DATA_ROUTE_DEMO = 0x91 , UNKNOWN_FUNC_GET_PRIORITY_ROUTE = 0x92 , UNKNOWN_FUNC_SET_PRIORITY_ROUTE = 0x93 , UNKNOWN_FUNC_SERIAL_API_TEST = 0x95 , UNKNOWN_FUNC_UNKNOWN_0x98 = 0x98 , FUNC_ID_SERIAL_API_SLAVE_NODE_INFO = 0xa0 , FUNC_ID_APPLICATION_SLAVE_COMMAND_HANDLER = 0xa1 , FUNC_ID_ZW_SEND_SLAVE_NODE_INFO = 0xa2 , FUNC_ID_ZW_SEND_SLAVE_DATA = 0xa3 , FUNC_ID_ZW_SET_SLAVE_LEARN_MODE = 0xa4 , FUNC_ID_ZW_GET_VIRTUAL_NODES = 0xa5 , FUNC_ID_ZW_IS_VIRTUAL_NODE = 0xa6 , BridgeApplicationCommand = 0xa8 , SendDataBridge = 0xa9 , SendDataMulticastBridge = 0xab , UNKNOWN_FUNC_UNKNOWN_0xB4 = 0xb4 , UNKNOWN_FUNC_WATCH_DOG_ENABLE = 0xb6 , UNKNOWN_FUNC_WATCH_DOG_DISABLE = 0xb7 , UNKNOWN_FUNC_WATCH_DOG_KICK = 0xb8 , UNKNOWN_FUNC_UNKNOWN_0xB9 = 0xb9 , UNKNOWN_FUNC_RF_POWERLEVEL_GET = 0xba , UNKNOWN_FUNC_GET_LIBRARY_TYPE = 0xbd , UNKNOWN_FUNC_SEND_TEST_FRAME = 0xbe , UNKNOWN_FUNC_GET_PROTOCOL_STATUS = 0xbf , FUNC_ID_ZW_SET_PROMISCUOUS_MODE = 0xd0 , FUNC_ID_PROMISCUOUS_APPLICATION_COMMAND_HANDLER = 0xd1 , UNKNOWN_FUNC_UNKNOWN_0xD2 = 0xd2 , UNKNOWN_FUNC_UNKNOWN_0xD3 = 0xd3 , UNKNOWN_FUNC_UNKNOWN_0xD4 = 0xd4 , UNKNOWN_FUNC_UNKNOWN_0xEF = 0xef , UNKNOWN_FUNC_ZMEFreqChange = 0xf2 , UNKNOWN_FUNC_ZMERestore = 0xf3 , UNKNOWN_FUNC_ZMEBootloaderFlash = 0xf4 , UNKNOWN_FUNC_ZMECapabilities = 0xf5 , UNKNOWN_FUNC_ZMESerialAPIOptions = 0xf8 }