Hexiwear library for communicating with the on-board KW40Z BLE device. KW40Z handles also the touch buttons.
Dependents: Hexi_BLE_Example_Modified Hexi_BLE_Example_ModifiedPOTATO
Fork of Hexi_KW40Z by
Diff: Hexi_KW40Z.h
- Revision:
- 13:84ead63f7353
- Parent:
- 12:3f5ed7abc5c7
- Child:
- 14:241c491f985f
diff -r 3f5ed7abc5c7 -r 84ead63f7353 Hexi_KW40Z.h --- a/Hexi_KW40Z.h Mon Sep 26 05:28:55 2016 +0000 +++ b/Hexi_KW40Z.h Thu Aug 09 22:45:01 2018 +0000 @@ -41,6 +41,7 @@ //#define LIB_DEBUG 1 //#define RAW_DEBUG 1 +//#define RX_DEBUG 1 #define gHostInterface_startByte1 0x55 #define gHostInterface_startByte2 0xAA @@ -122,6 +123,10 @@ packetType_sleepON = 34, /**< sleep ON */ packetType_sleepOFF = 35, /**< sleep OFF */ + /* Message Service */ + packetType_messageIn = 116, /**< incoming alerts */ + packetType_messageOut = 117, /**< outcoming alerts */ + packetType_OK = 255 /**< OK packet */ } hostInterface_packetType_t; @@ -155,6 +160,7 @@ typedef void (*button_t)(void); typedef void (*alert_t)(uint8_t *data, uint8_t length); +typedef void (*message_t)(uint8_t *data, uint8_t length); //typedef void (*passkey_t)(uint8_t *data); typedef void (*passkey_t)(void); typedef void (*notifications_t)(uint8_t eventId, uint8_t categoryId); @@ -191,6 +197,7 @@ void attach_buttonSlide(button_t btnFct); void attach_alert(alert_t alertFct); + void attach_message(message_t msgFct); void attach_passkey(passkey_t passkeyFct); void attach_notifications(notifications_t notFct); @@ -206,6 +213,7 @@ void SendSteps(uint16_t steps); void SendCalories(uint16_t calories); void SendAlert(uint8_t *pData, uint8_t length); + void SendMessage(uint8_t *pData, uint8_t length); void SendSetApplicationMode(gui_current_app_t mode); void SendGetVersion(void); @@ -220,7 +228,7 @@ uint32_t GetPassKey(void); private: -#if defined (LIB_DEBUG) || defined (RAW_DEBUG) +#if defined (LIB_DEBUG) || defined (RAW_DEBUG) || defined (RX_DEBUG) RawSerial pc; #endif @@ -238,6 +246,7 @@ button_t buttonSlideCb; alert_t alertCb; + message_t messageCb; passkey_t passkeyCb; notifications_t notificationsCb; @@ -267,7 +276,7 @@ void SendGetAdvertisementMode(void); void SendGetLinkState(void); -#if defined (LIB_DEBUG) +#if defined (LIB_DEBUG) || defined (RX_DEBUG) void DebugPrintPacket(hostInterface_packet_t * packet); #endif };