Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
|
I decided to participate in the contest Revolutionize Your IoT Prototyping - with NXP some time ago and my proposed project Iot for bees (& beekeepers a bit too) won the hardware NXP Rapid IoT Development Kit. It took one month to push the package thru customs (and pay the the duty) but finally I had the package and started to learn how to use it.
I realize I would need additional components so I used the extra voucher provided to contestants and ordered some stuff from MikroElektronika - Hexiwear docking station compatible with NXP Rapid IoT Development Kit (well, I have to admit I ordered it in the kit with Hexiwear too – do not tell my wife... ;)) and Sigfox Click module (variant for EU).
On the SigFox Click module there it written "Activate your Sigfox click by using the ID and PAC numbers which you can find on the package box of your SigFox Click board™." but there was nothing like that on my package. I found the guidance how to retrieve the SigFox ID using the debug print in this video:
But... why not to use the NXP Rapid IoT Development Kit display?! So I created this simple script. First to get what I needed – Sigfox ID and PAC for my SigFox click module and second to learn a bit with this (for me) new technology.
The project will retrieve the SigFox ID but I believe the modification to retrieve PAC is really easy and understandable to everyone.
This is how the set looks like (please mind the docking station must be set up as described in NXP Rapid IoT Development Kit user's guide before using it with NXP Rapid IoT Development Kit).
...just press the upper right button or touch right side of your NXP Rapid IoT Development Kit and you will get your SigFox ID:
Note at the end: I am not able to activate my SigFox Click module under my already existing SigFox backend account even with known ID & PAC. Just contacted MikroElektronika with the request for support.
#include "callbacks.h"
//HEADER START
//HEADER END
void ATMO_Setup() {
}
ATMO_Status_t TopRightButton_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t TopRightButton_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_MK64F_GPIO_EnableResetCombo(ATMO_PROPERTY(TopRightButton, enableResetCombo));
ATMO_MK64F_GPIO_EnableDisplayToggleCombo(ATMO_PROPERTY(TopRightButton, enableDisplayToggleCombo));
ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW1_Pushed, ATMO_ABILITY(TopRightButton, topRightPushed));
ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW2_Pushed, ATMO_ABILITY(TopRightButton, bottomRightPushed));
ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW3_Pushed, ATMO_ABILITY(TopRightButton, topLeftPushed));
ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW4_Pushed, ATMO_ABILITY(TopRightButton, bottomLeftPushed));
return ATMO_Status_Success;
}
ATMO_Status_t TopRightButton_topRightPushed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t TopRightButton_bottomRightPushed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t TopRightButton_topLeftPushed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t TopRightButton_bottomLeftPushed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigfoxClickID_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigfoxClickID_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_SIGFOX_CLICK_Config_t config;
config.spiInstance = ATMO_PROPERTY(SigfoxClickID, spiDriverInstance);
config.gpioInstance = ATMO_PROPERTY(SigfoxClickID, gpioDriverInstance);
config.csPin = ATMO_PROPERTY(SigfoxClickID, csPin);
config.rstPin = ATMO_PROPERTY(SigfoxClickID, rstPin);
config.ackPin = ATMO_PROPERTY(SigfoxClickID, ackPin);
config.txAtten = ATMO_PROPERTY(SigfoxClickID, txAtten);
config.netStandard = ATMO_PROPERTY(SigfoxClickID, netStandard);
config.usePublicKey = ATMO_PROPERTY(SigfoxClickID, publicKey);
ATMO_SIGFOX_CLICK_RegisterAbilityHandle(ATMO_SIGFOX_CLICK_EVENT_PayloadSent, ATMO_ABILITY(SigfoxClickID, payloadSent));
ATMO_SIGFOX_CLICK_RegisterAbilityHandle(ATMO_SIGFOX_CLICK_EVENT_ResponseReceived, ATMO_ABILITY(SigfoxClickID, responseReceived));
ATMO_SIGFOX_CLICK_RegisterAbilityHandle(ATMO_SIGFOX_CLICK_EVENT_Error, ATMO_ABILITY(SigfoxClickID, txRxError));
return ATMO_SIGFOX_CLICK_Init(&config) == ATMO_SIGFOX_CLICK_Status_Success ? ATMO_Status_Success : ATMO_Status_Fail;
}
ATMO_Status_t SigfoxClickID_sendPayload(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_Value_t payloadValue;
ATMO_InitValue(&payloadValue);
ATMO_CreateValueConverted(&payloadValue, ATMO_PROPERTY(SigfoxClickID, upstreamDataType), in);
ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_SendPayload(payloadValue.data, payloadValue.size, false);
ATMO_FreeValue(&payloadValue);
return status == ATMO_SIGFOX_CLICK_Status_Success ? ATMO_Status_Success : ATMO_Status_Fail;
}
ATMO_Status_t SigfoxClickID_sendPayloadReqResponse(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_Value_t payloadValue;
ATMO_InitValue(&payloadValue);
ATMO_CreateValueConverted(&payloadValue, ATMO_PROPERTY(SigfoxClickID, upstreamDataType), in);
ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_SendPayload(payloadValue.data, payloadValue.size, true);
ATMO_FreeValue(&payloadValue);
return status == ATMO_SIGFOX_CLICK_Status_Success ? ATMO_Status_Success : ATMO_Status_Fail;
}
ATMO_Status_t SigfoxClickID_getDeviceId(ATMO_Value_t *in, ATMO_Value_t *out) {
sf_device_info_t info;
ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_GetDeviceInfo(&info);
if(status != ATMO_SIGFOX_CLICK_Status_Success)
{
return ATMO_Status_Fail;
}
char devIdStr[9] = {0};
sprintf(devIdStr, "%02X%02X%02X%02X",
(info.devId >> 24) & 0xFF,
(info.devId >> 16) & 0xFF,
(info.devId >> 8) & 0xFF,
(info.devId) & 0xFF);
ATMO_CreateValueString(out, devIdStr);
return ATMO_Status_Success;
}
ATMO_Status_t SigfoxClickID_getPac(ATMO_Value_t *in, ATMO_Value_t *out) {
sf_device_info_t info;
ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_GetDeviceInfo(&info);
if(status != ATMO_SIGFOX_CLICK_Status_Success)
{
return ATMO_Status_Fail;
}
char devPacStr[17] = {0};
sprintf(devPacStr, "%02X%02X%02X%02X%02X%02X%02X%02X",
info.devPac[0],
info.devPac[1],
info.devPac[2],
info.devPac[3],
info.devPac[4],
info.devPac[5],
info.devPac[6],
info.devPac[7]);
ATMO_CreateValueString(out, devPacStr);
return ATMO_Status_Success;
}
ATMO_Status_t SigfoxClickID_payloadSent(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigfoxClickID_responseReceived(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_CreateValueConverted(out, ATMO_PROPERTY(SigfoxClickID, downstreamDataType), in);
return ATMO_Status_Success;
}
ATMO_Status_t SigfoxClickID_txRxError(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_BLACK);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setColorPreset(ATMO_Value_t *in, ATMO_Value_t *out) {
unsigned int desiredColor = 0;
ATMO_GetUnsignedInt(in, &desiredColor);
uint8_t brightness = 0;
uint8_t color = 0;
RGB_Led_Get_State(&brightness, &color);
RGB_Led_Set_State(brightness, desiredColor);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setBrightnessLow(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t brightness = 0;
uint8_t color = 0;
RGB_Led_Get_State(&brightness, &color);
RGB_Led_Set_State(RGB_LED_BRIGHT_LOW, color);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setBrightnessOff(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t brightness = 0;
uint8_t color = 0;
RGB_Led_Get_State(&brightness, &color);
RGB_Led_Set_State(RGB_LED_BRIGHT_OFF, color);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setBrightnessMedium(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t brightness = 0;
uint8_t color = 0;
RGB_Led_Get_State(&brightness, &color);
RGB_Led_Set_State(RGB_LED_BRIGHT_MEDIUM, color);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setBrightnessHigh(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t brightness = 0;
uint8_t color = 0;
RGB_Led_Get_State(&brightness, &color);
RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, color);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setRedOn(ATMO_Value_t *in, ATMO_Value_t *out) {
RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_RED);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setGreenOn(ATMO_Value_t *in, ATMO_Value_t *out) {
RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_GREEN);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setBlueOn(ATMO_Value_t *in, ATMO_Value_t *out) {
RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_BLUE);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setWhiteOn(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_toggleRed(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t color, brightness;
RGB_Led_Get_State(&brightness, &color);
if(brightness == RGB_LED_BRIGHT_OFF || color == RGB_LED_COLOR_BLACK)
{
brightness = RGB_LED_BRIGHT_HIGH;
}
else
{
brightness = RGB_LED_BRIGHT_OFF;
}
RGB_Led_Set_State(brightness, RGB_LED_COLOR_RED);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_toggleGreen(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t color, brightness;
RGB_Led_Get_State(&brightness, &color);
if(brightness == RGB_LED_BRIGHT_OFF || color == RGB_LED_COLOR_BLACK)
{
brightness = RGB_LED_BRIGHT_HIGH;
}
else
{
brightness = RGB_LED_BRIGHT_OFF;
}
RGB_Led_Set_State(brightness, RGB_LED_COLOR_GREEN);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_toggleBlue(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t color, brightness;
RGB_Led_Get_State(&brightness, &color);
if(brightness == RGB_LED_BRIGHT_OFF || color == RGB_LED_COLOR_BLACK)
{
brightness = RGB_LED_BRIGHT_HIGH;
}
else
{
brightness = RGB_LED_BRIGHT_OFF;
}
RGB_Led_Set_State(brightness, RGB_LED_COLOR_BLUE);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setOff(ATMO_Value_t *in, ATMO_Value_t *out) {
uint8_t color, brightness;
RGB_Led_Get_State(&brightness, &color);
RGB_Led_Set_State(brightness, RGB_LED_COLOR_BLACK);
return ATMO_Status_Success;
}
ATMO_Status_t RGBLed_setColorHex(ATMO_Value_t *in, ATMO_Value_t *out) {
unsigned int color = 0;
ATMO_GetUnsignedInt(in, &color);
uint8_t red = (color >> 16) & 0xFF;
uint8_t green = (color >> 8) & 0xFF;
uint8_t blue = color & 0xFF;
Rgb_Led_Set_Colors(red, green, blue);
ATMO_CreateValueUnsignedInt(out, color);
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_displayPage(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(SigFoxIDpage, x), ATMO_PROPERTY(SigFoxIDpage, y), false);
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_onDisplayed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_topRightButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_bottomRightButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_topLeftButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_bottomLeftButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_UI_PAGE_Config_t config;
config.hidden = ATMO_PROPERTY(SigFoxIDpage, pageHidden);
config.textColor = ATMO_PROPERTY(SigFoxIDpage, textColor);
config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(SigFoxIDpage, topRightButtonEnabled),
ATMO_PROPERTY(SigFoxIDpage,bottomRightButtonEnabled), ATMO_PROPERTY(SigFoxIDpage, topLeftButtonEnabled), ATMO_PROPERTY(SigFoxIDpage, bottomLeftButtonEnabled));
config.x = ATMO_PROPERTY(SigFoxIDpage, x);
config.x = ATMO_PROPERTY(SigFoxIDpage, x);
config.y = ATMO_PROPERTY(SigFoxIDpage, y);
strncpy(config.topLeftButtonLabel, ATMO_PROPERTY(SigFoxIDpage, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
strncpy(config.topRightButtonLabel, ATMO_PROPERTY(SigFoxIDpage, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
strncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(SigFoxIDpage, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
strncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(SigFoxIDpage, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
config.spanX = ATMO_PROPERTY(SigFoxIDpage, spanX);
config.spanY = ATMO_PROPERTY(SigFoxIDpage, spanY);
config.title = ATMO_PROPERTY(SigFoxIDpage, pageTitle);
config.titleHidden = ATMO_PROPERTY(SigFoxIDpage, titleHidden);
ATMO_UI_SINGLEICONTEXT_Init(&config);
ATMO_VARIABLE(SigFoxIDpage, pageHandle) = config.templateInstance;
ATMO_UI_SINGLEICONTEXT_SetMainText(config.templateInstance, ATMO_PROPERTY(SigFoxIDpage, label));
ATMO_UI_SINGLEICONTEXT_SetIcon(config.templateInstance, ATMO_PROPERTY(SigFoxIDpage, icon));
ATMO_UI_SINGLEICONTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), ATMO_ABILITY(SigFoxIDpage, onDisplayed));
ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 1, ATMO_ABILITY(SigFoxIDpage, topRightButtonPressed));
ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 2, ATMO_ABILITY(SigFoxIDpage, bottomRightButtonPressed));
ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 3, ATMO_ABILITY(SigFoxIDpage, topLeftButtonPressed));
ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 4, ATMO_ABILITY(SigFoxIDpage, bottomLeftButtonPressed));
ATMO_UI_SINGLEICONTEXT_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(SigFoxIDpage, onLeave));
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_onLeave(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t SigFoxIDpage_setLabel(ATMO_Value_t *in, ATMO_Value_t *out) {
char label[32];
if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)
{
ATMO_UI_SINGLEICONTEXT_SetMainText(ATMO_VARIABLE(SigFoxIDpage,pageHandle), label);
}
else
{
return ATMO_Status_Fail;
}
return ATMO_Status_Success;
}
ATMO_Status_t IDDebugPrint_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t IDDebugPrint_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t IDDebugPrint_print(ATMO_Value_t *in, ATMO_Value_t *out) {
if((in != NULL) && (in->type != ATMO_DATATYPE_VOID))
{
char str[256];
unsigned int prependLen = strlen(ATMO_PROPERTY(IDDebugPrint, prepend));
// If there's text to prepend, do that first
if(prependLen > 0)
{
sprintf(str, "%s: ", ATMO_PROPERTY(IDDebugPrint, prepend));
prependLen += 2; // Adding 2 chars for ": "
}
// Grab the string version of the input data, place it after the prepend text
if(ATMO_GetString(in, str + prependLen, 256 - prependLen) == ATMO_Status_Success)
{
ATMO_PLATFORM_DebugPrint("%s\r\n", str);
}
}
else
{
ATMO_PLATFORM_DebugPrint("%s\r\n", ATMO_PROPERTY(IDDebugPrint, prepend));
}
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_displayPage(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(InitialPage, x), ATMO_PROPERTY(InitialPage, y), false);
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_topRightButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_bottomRightButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_topLeftButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_bottomLeftButtonPressed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_onDisplayed(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_setText(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_Value_t strVal;
ATMO_InitValue(&strVal);
ATMO_CreateValueConverted(&strVal, ATMO_DATATYPE_STRING, in);
ATMO_UI_STATICTEXT_SetText(ATMO_VARIABLE(InitialPage,pageHandle), strVal.data);
ATMO_FreeValue(&strVal);
return ATMO_Status_Success;
}
ATMO_Status_t InitialPage_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_UI_PAGE_Config_t config;
config.hidden = ATMO_PROPERTY(InitialPage, pageHidden);
config.textColor = ATMO_PROPERTY(InitialPage, textColor);
config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(InitialPage, topRightButtonEnabled),
ATMO_PROPERTY(InitialPage,bottomRightButtonEnabled), ATMO_PROPERTY(InitialPage, topLeftButtonEnabled), ATMO_PROPERTY(InitialPage, bottomLeftButtonEnabled));
config.x = ATMO_PROPERTY(InitialPage, x);
config.y = ATMO_PROPERTY(InitialPage, y);
strncpy(config.topLeftButtonLabel, ATMO_PROPERTY(InitialPage, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
strncpy(config.topRightButtonLabel, ATMO_PROPERTY(InitialPage, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
strncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(InitialPage, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
strncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(InitialPage, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);
config.spanX = ATMO_PROPERTY(InitialPage, spanX);
config.spanY = ATMO_PROPERTY(InitialPage, spanY);
config.title = ATMO_PROPERTY(InitialPage, pageTitle);
config.titleHidden = ATMO_PROPERTY(InitialPage, titleHidden);
ATMO_UI_STATICTEXT_Init(&config);
ATMO_VARIABLE(InitialPage, pageHandle) = config.templateInstance;
ATMO_UI_STATICTEXT_SetText(config.templateInstance, ATMO_PROPERTY(InitialPage, text));
ATMO_UI_STATICTEXT_SetTextSize(config.templateInstance, ATMO_PROPERTY(InitialPage, fontSize));
ATMO_UI_STATICTEXT_SetAlignment(config.templateInstance, ATMO_PROPERTY(InitialPage, horizontalAlignment));
ATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 1, ATMO_ABILITY(InitialPage, topRightButtonPressed));
ATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 2, ATMO_ABILITY(InitialPage, bottomRightButtonPressed));
ATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 3, ATMO_ABILITY(InitialPage, topLeftButtonPressed));
ATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 4, ATMO_ABILITY(InitialPage, bottomLeftButtonPressed));
if(!config.hidden)
{
ATMO_UI_STATICTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), ATMO_ABILITY(InitialPage, onDisplayed));
}
return ATMO_Status_Success;
}
ATMO_Status_t LEDresetInterval_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t LEDresetInterval_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_INTERVAL_Handle_t intervalHandle;
ATMO_INTERVAL_AddAbilityInterval(
ATMO_PROPERTY(LEDresetInterval, instance),
ATMO_ABILITY(LEDresetInterval, interval),
ATMO_PROPERTY(LEDresetInterval, time),
&intervalHandle
);
return ATMO_Status_Success;
}
ATMO_Status_t LEDresetInterval_interval(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t RightTouch_trigger(ATMO_Value_t *in, ATMO_Value_t *out) {
return ATMO_Status_Success;
}
ATMO_Status_t RightTouch_setup(ATMO_Value_t *in, ATMO_Value_t *out) {
ATMO_SX9500_Config_t config;
config.address = ATMO_PROPERTY(RightTouch, i2cAddress);
config.i2cDriverInstance = ATMO_PROPERTY(RightTouch, i2cInstance);
config.gpioDriverInstance = ATMO_PROPERTY(RightTouch, gpioInstance);
config.interruptEnabled = ATMO_PROPERTY(RightTouch, interruptEnabled);
config.interruptPin = ATMO_PROPERTY(RightTouch, interruptGpio);
ATMO_SX9500_Init(&config);
ATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Up, ATMO_ABILITY(RightTouch, pressUp));
ATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Down, ATMO_ABILITY(RightTouch, pressDown));
ATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Left, ATMO_ABILITY(RightTouch, pressLeft));
ATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Right, ATMO_ABILITY(RightTouch, pressRight));
return ATMO_Status_Success;
}
ATMO_Status_t RightTouch_getTouchData(ATMO_Value_t *in, ATMO_Value_t *out) {
return;
}
ATMO_Status_t RightTouch_pressUp(ATMO_Value_t *in, ATMO_Value_t *out) {
SX9500_TouchState_t touchState;
ATMO_GetBinary(in, &touchState, sizeof(touchState));
ATMO_CreateValueBinary(out, &touchState, sizeof(touchState));
return ATMO_Status_Success;
}
ATMO_Status_t RightTouch_pressDown(ATMO_Value_t *in, ATMO_Value_t *out) {
SX9500_TouchState_t touchState;
ATMO_GetBinary(in, &touchState, sizeof(touchState));
ATMO_CreateValueBinary(out, &touchState, sizeof(touchState));
return ATMO_Status_Success;
}
ATMO_Status_t RightTouch_pressLeft(ATMO_Value_t *in, ATMO_Value_t *out) {
SX9500_TouchState_t touchState;
ATMO_GetBinary(in, &touchState, sizeof(touchState));
ATMO_CreateValueBinary(out, &touchState, sizeof(touchState));
return ATMO_Status_Success;
}
ATMO_Status_t RightTouch_pressRight(ATMO_Value_t *in, ATMO_Value_t *out) {
SX9500_TouchState_t touchState;
ATMO_GetBinary(in, &touchState, sizeof(touchState));
ATMO_CreateValueBinary(out, &touchState, sizeof(touchState));
return ATMO_Status_Success;
}
//FOOTER START
//FOOTER END
{
"name": "Get Sigfox ID",
"createVersion": "2017-08-12",
"description": "Retrieves SigFox Click module ID, shows it on the screen and prints out as a debug. Expects Hexiwear docking station and SigFox Click module in slot #3. Could be easily updated to show SigFox PAC.",
"lastModified": "2019-01-29T18:54:45.134Z",
"created": "2019-01-29T18:54:45.134Z",
"meta": {
"projectTypeName": "NXP Rapid IoT",
"projectTypeId": "NxpRpk"
},
"planes": {
"NXP Rapid IoT": {
"type": "mcuxpresso",
"compilerVersion": "latest",
"variants": [
"NxpRpk"
],
"meta": {},
"elements": [
{
"name": "TopRightButton",
"type": "EmbeddedNxpRpkUserButtons",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n ATMO_MK64F_GPIO_EnableResetCombo(ATMO_PROPERTY(TopRightButton, enableResetCombo));\n ATMO_MK64F_GPIO_EnableDisplayToggleCombo(ATMO_PROPERTY(TopRightButton, enableDisplayToggleCombo));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW1_Pushed, ATMO_ABILITY(TopRightButton, topRightPushed));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW2_Pushed, ATMO_ABILITY(TopRightButton, bottomRightPushed));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW3_Pushed, ATMO_ABILITY(TopRightButton, topLeftPushed));\n ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW4_Pushed, ATMO_ABILITY(TopRightButton, bottomLeftPushed));\n\treturn ATMO_Status_Success;\n\t",
"topRightPushed": "\n\treturn ATMO_Status_Success;\n ",
"bottomRightPushed": "\n\treturn ATMO_Status_Success;\n ",
"topLeftPushed": "\n\treturn ATMO_Status_Success;\n ",
"bottomLeftPushed": "\n\treturn ATMO_Status_Success;\n "
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"topRightPushed": false,
"bottomRightPushed": false,
"topLeftPushed": false,
"bottomLeftPushed": false
},
"enableResetCombo": true,
"enableDisplayToggleCombo": true
},
"meta": {
"editorX": 128,
"editorY": 93,
"lastTrigger": "topRightPushed"
},
"triggers": {
"triggered": [],
"topRightPushed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "RGBLed",
"targetAbility": "toggleRed"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "SigfoxClickID",
"targetAbility": "getDeviceId"
}
],
"bottomRightPushed": [],
"topLeftPushed": [],
"bottomLeftPushed": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"topRightPushed": false,
"bottomRightPushed": false,
"topLeftPushed": false,
"bottomLeftPushed": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "topRightPushed",
"triggers": [
"topRightPushed"
]
},
{
"name": "bottomRightPushed",
"triggers": [
"bottomRightPushed"
]
},
{
"name": "topLeftPushed",
"triggers": [
"topLeftPushed"
]
},
{
"name": "bottomLeftPushed",
"triggers": [
"bottomLeftPushed"
]
}
]
},
{
"name": "SigfoxClickID",
"type": "EmbeddedSigfoxClick",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": " ATMO_SIGFOX_CLICK_Config_t config;\r\n config.spiInstance = ATMO_PROPERTY(SigfoxClickID, spiDriverInstance);\r\n config.gpioInstance = ATMO_PROPERTY(SigfoxClickID, gpioDriverInstance);\r\n config.csPin = ATMO_PROPERTY(SigfoxClickID, csPin);\r\n config.rstPin = ATMO_PROPERTY(SigfoxClickID, rstPin);\r\n config.ackPin = ATMO_PROPERTY(SigfoxClickID, ackPin);\r\n config.txAtten = ATMO_PROPERTY(SigfoxClickID, txAtten);\r\n config.netStandard = ATMO_PROPERTY(SigfoxClickID, netStandard);\r\n config.usePublicKey = ATMO_PROPERTY(SigfoxClickID, publicKey);\r\n ATMO_SIGFOX_CLICK_RegisterAbilityHandle(ATMO_SIGFOX_CLICK_EVENT_PayloadSent, ATMO_ABILITY(SigfoxClickID, payloadSent));\r\n ATMO_SIGFOX_CLICK_RegisterAbilityHandle(ATMO_SIGFOX_CLICK_EVENT_ResponseReceived, ATMO_ABILITY(SigfoxClickID, responseReceived));\r\n ATMO_SIGFOX_CLICK_RegisterAbilityHandle(ATMO_SIGFOX_CLICK_EVENT_Error, ATMO_ABILITY(SigfoxClickID, txRxError));\r\n return ATMO_SIGFOX_CLICK_Init(&config) == ATMO_SIGFOX_CLICK_Status_Success ? ATMO_Status_Success : ATMO_Status_Fail;",
"sendPayload": " ATMO_Value_t payloadValue;\r\n ATMO_InitValue(&payloadValue);\r\n ATMO_CreateValueConverted(&payloadValue, ATMO_PROPERTY(SigfoxClickID, upstreamDataType), in);\r\n ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_SendPayload(payloadValue.data, payloadValue.size, false);\r\n ATMO_FreeValue(&payloadValue);\r\n return status == ATMO_SIGFOX_CLICK_Status_Success ? ATMO_Status_Success : ATMO_Status_Fail;",
"sendPayloadReqResponse": " ATMO_Value_t payloadValue;\r\n ATMO_InitValue(&payloadValue);\r\n ATMO_CreateValueConverted(&payloadValue, ATMO_PROPERTY(SigfoxClickID, upstreamDataType), in);\r\n ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_SendPayload(payloadValue.data, payloadValue.size, true);\r\n ATMO_FreeValue(&payloadValue);\r\n return status == ATMO_SIGFOX_CLICK_Status_Success ? ATMO_Status_Success : ATMO_Status_Fail;",
"getDeviceId": " sf_device_info_t info;\r\n ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_GetDeviceInfo(&info);\r\n\r\n if(status != ATMO_SIGFOX_CLICK_Status_Success)\r\n {\r\n return ATMO_Status_Fail;\r\n }\r\n\r\n char devIdStr[9] = {0};\r\n\r\n sprintf(devIdStr, \"%02X%02X%02X%02X\", \r\n (info.devId >> 24) & 0xFF,\r\n (info.devId >> 16) & 0xFF,\r\n (info.devId >> 8) & 0xFF,\r\n (info.devId) & 0xFF);\r\n\r\n ATMO_CreateValueString(out, devIdStr);\r\n return ATMO_Status_Success;",
"getPac": " sf_device_info_t info;\r\n ATMO_SIGFOX_CLICK_Status_t status = ATMO_SIGFOX_CLICK_GetDeviceInfo(&info);\r\n\r\n if(status != ATMO_SIGFOX_CLICK_Status_Success)\r\n {\r\n return ATMO_Status_Fail;\r\n }\r\n\r\n char devPacStr[17] = {0};\r\n\r\n sprintf(devPacStr, \"%02X%02X%02X%02X%02X%02X%02X%02X\", \r\n info.devPac[0],\r\n info.devPac[1],\r\n info.devPac[2],\r\n info.devPac[3],\r\n info.devPac[4],\r\n info.devPac[5],\r\n info.devPac[6],\r\n info.devPac[7]);\r\n\r\n ATMO_CreateValueString(out, devPacStr);\r\n return ATMO_Status_Success;",
"payloadSent": "return ATMO_Status_Success;",
"responseReceived": " ATMO_CreateValueConverted(out, ATMO_PROPERTY(SigfoxClickID, downstreamDataType), in);\r\n return ATMO_Status_Success;",
"txRxError": "return ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"sendPayload": false,
"sendPayloadReqResponse": false,
"getDeviceId": false,
"getPac": false,
"payloadSent": false,
"responseReceived": false,
"txRxError": false
},
"gpioDriverInstance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
"spiDriverInstance": "ATMO_DRIVERINSTANCE_SPI_SPI1",
"csPin": "MB3_CS",
"ackPin": "MB3_AN",
"rstPin": "MB3_RST",
"netStandard": "sfNetStandardETSI",
"txAtten": 0,
"publicKey": false,
"upstreamDataType": "ATMO_DATATYPE_BINARY",
"downstreamDataType": "ATMO_DATATYPE_BINARY"
},
"meta": {
"editorX": 249,
"editorY": 33,
"lastTrigger": "deviceIdRetrieved"
},
"triggers": {
"triggered": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "SigFoxIDpage",
"targetAbility": "setLabel"
}
],
"deviceIdRetrieved": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "IDDebugPrint",
"targetAbility": "print"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "SigFoxIDpage",
"targetAbility": "setLabel"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "SigFoxIDpage",
"targetAbility": "displayPage"
}
],
"pacRetrieved": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "SigFoxIDpage",
"targetAbility": "setLabel"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "SigFoxIDpage",
"targetAbility": "displayPage"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "IDDebugPrint",
"targetAbility": "print"
}
],
"payloadSent": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "IDDebugPrint",
"targetAbility": "print"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "SigFoxIDpage",
"targetAbility": "setLabel"
}
],
"responseReceived": [],
"txRxError": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"sendPayload": false,
"sendPayloadReqResponse": false,
"getDeviceId": false,
"getPac": false,
"payloadSent": false,
"responseReceived": false,
"txRxError": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "sendPayload",
"triggers": []
},
{
"name": "sendPayloadReqResponse",
"triggers": []
},
{
"name": "getDeviceId",
"triggers": [
"deviceIdRetrieved"
]
},
{
"name": "getPac",
"triggers": [
"pacRetrieved"
]
},
{
"name": "payloadSent",
"triggers": [
"payloadSent"
]
},
{
"name": "responseReceived",
"triggers": [
"responseReceived"
]
},
{
"name": "txRxError",
"triggers": [
"txRxError"
]
}
]
},
{
"name": "RGBLed",
"type": "EmbeddedNxpRpkRgbLed",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_BLACK);\n\treturn ATMO_Status_Success;\n\t",
"setColorPreset": "\n unsigned int desiredColor = 0;\n ATMO_GetUnsignedInt(in, &desiredColor);\n\n uint8_t brightness = 0;\n uint8_t color = 0;\n RGB_Led_Get_State(&brightness, &color);\n RGB_Led_Set_State(brightness, desiredColor);\n return ATMO_Status_Success;\n ",
"setBrightnessLow": "\n uint8_t brightness = 0;\n uint8_t color = 0;\n RGB_Led_Get_State(&brightness, &color);\n RGB_Led_Set_State(RGB_LED_BRIGHT_LOW, color);\n return ATMO_Status_Success;\n ",
"setBrightnessOff": "\n uint8_t brightness = 0;\n uint8_t color = 0;\n RGB_Led_Get_State(&brightness, &color);\n RGB_Led_Set_State(RGB_LED_BRIGHT_OFF, color);\n return ATMO_Status_Success;\n ",
"setBrightnessMedium": "\n uint8_t brightness = 0;\n uint8_t color = 0;\n RGB_Led_Get_State(&brightness, &color);\n RGB_Led_Set_State(RGB_LED_BRIGHT_MEDIUM, color);\n return ATMO_Status_Success;\n ",
"setBrightnessHigh": "\n uint8_t brightness = 0;\n uint8_t color = 0;\n RGB_Led_Get_State(&brightness, &color);\n RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, color);\n return ATMO_Status_Success;\n ",
"setRedOn": "\n RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_RED);\n\treturn ATMO_Status_Success;\n ",
"setGreenOn": "\n RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_GREEN);\n\treturn ATMO_Status_Success;\n ",
"setBlueOn": "\n RGB_Led_Set_State(RGB_LED_BRIGHT_HIGH, RGB_LED_COLOR_BLUE);\n\treturn ATMO_Status_Success;\n ",
"setWhiteOn": "\treturn ATMO_Status_Success;",
"toggleRed": "\n\tuint8_t color, brightness;\n RGB_Led_Get_State(&brightness, &color);\n if(brightness == RGB_LED_BRIGHT_OFF || color == RGB_LED_COLOR_BLACK)\n {\n brightness = RGB_LED_BRIGHT_HIGH;\n }\n else\n {\n brightness = RGB_LED_BRIGHT_OFF;\n }\n\n RGB_Led_Set_State(brightness, RGB_LED_COLOR_RED);\n return ATMO_Status_Success;\n\t",
"toggleGreen": "\n\tuint8_t color, brightness;\n RGB_Led_Get_State(&brightness, &color);\n if(brightness == RGB_LED_BRIGHT_OFF || color == RGB_LED_COLOR_BLACK)\n {\n brightness = RGB_LED_BRIGHT_HIGH;\n }\n else\n {\n brightness = RGB_LED_BRIGHT_OFF;\n }\n\n RGB_Led_Set_State(brightness, RGB_LED_COLOR_GREEN);\n return ATMO_Status_Success;\n\t",
"toggleBlue": "\n\tuint8_t color, brightness;\n RGB_Led_Get_State(&brightness, &color);\n if(brightness == RGB_LED_BRIGHT_OFF || color == RGB_LED_COLOR_BLACK)\n {\n brightness = RGB_LED_BRIGHT_HIGH;\n }\n else\n {\n brightness = RGB_LED_BRIGHT_OFF;\n }\n\n RGB_Led_Set_State(brightness, RGB_LED_COLOR_BLUE);\n return ATMO_Status_Success;\n\t",
"setOff": "\n uint8_t color, brightness;\n RGB_Led_Get_State(&brightness, &color);\n RGB_Led_Set_State(brightness, RGB_LED_COLOR_BLACK);\n\treturn ATMO_Status_Success;\n ",
"setColorHex": "\n unsigned int color = 0;\n ATMO_GetUnsignedInt(in, &color);\n uint8_t red = (color >> 16) & 0xFF;\n uint8_t green = (color >> 8) & 0xFF;\n uint8_t blue = color & 0xFF;\n Rgb_Led_Set_Colors(red, green, blue); \n ATMO_CreateValueUnsignedInt(out, color);\n\treturn ATMO_Status_Success;\n "
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"setColorPreset": false,
"setBrightnessLow": false,
"setBrightnessOff": false,
"setBrightnessMedium": false,
"setBrightnessHigh": false,
"setRedOn": false,
"setGreenOn": false,
"setBlueOn": false,
"setWhiteOn": false,
"toggleRed": false,
"toggleGreen": false,
"toggleBlue": false,
"setOff": false,
"setColorHex": false
}
},
"meta": {
"editorX": 253,
"editorY": 139,
"lastTrigger": "colorSet"
},
"triggers": {
"triggered": [],
"brightnessSet": [],
"colorSet": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"setColorPreset": false,
"setBrightnessLow": false,
"setBrightnessOff": false,
"setBrightnessMedium": false,
"setBrightnessHigh": false,
"setRedOn": false,
"setGreenOn": false,
"setBlueOn": false,
"setWhiteOn": false,
"toggleRed": false,
"toggleGreen": false,
"toggleBlue": false,
"setOff": false,
"setColorHex": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "setColorPreset",
"triggers": []
},
{
"name": "setBrightnessLow",
"triggers": [
"brightnessSet"
]
},
{
"name": "setBrightnessOff",
"triggers": [
"brightnessSet"
]
},
{
"name": "setBrightnessMedium",
"triggers": [
"brightnessSet"
]
},
{
"name": "setBrightnessHigh",
"triggers": [
"brightnessSet"
]
},
{
"name": "setRedOn",
"triggers": []
},
{
"name": "setGreenOn",
"triggers": []
},
{
"name": "setBlueOn",
"triggers": []
},
{
"name": "setWhiteOn",
"triggers": []
},
{
"name": "toggleRed",
"triggers": []
},
{
"name": "toggleGreen",
"triggers": []
},
{
"name": "toggleBlue",
"triggers": []
},
{
"name": "setOff",
"triggers": []
},
{
"name": "setColorHex",
"triggers": [
"colorSet"
]
}
]
},
{
"name": "SigFoxIDpage",
"type": "EmbeddedIconLabelDisplay",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(SigFoxIDpage, x), ATMO_PROPERTY(SigFoxIDpage, y), false);\n\treturn ATMO_Status_Success;\n\t",
"onDisplayed": "\n\treturn ATMO_Status_Success;\n ",
"topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"setup": "\n ATMO_UI_PAGE_Config_t config;\n\tconfig.hidden = ATMO_PROPERTY(SigFoxIDpage, pageHidden);\n\tconfig.textColor = ATMO_PROPERTY(SigFoxIDpage, textColor);\n config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(SigFoxIDpage, topRightButtonEnabled),\n ATMO_PROPERTY(SigFoxIDpage,bottomRightButtonEnabled), ATMO_PROPERTY(SigFoxIDpage, topLeftButtonEnabled), ATMO_PROPERTY(SigFoxIDpage, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(SigFoxIDpage, x);\n config.x = ATMO_PROPERTY(SigFoxIDpage, x);\n config.y = ATMO_PROPERTY(SigFoxIDpage, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(SigFoxIDpage, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(SigFoxIDpage, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(SigFoxIDpage, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(SigFoxIDpage, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n config.spanX = ATMO_PROPERTY(SigFoxIDpage, spanX);\n\tconfig.spanY = ATMO_PROPERTY(SigFoxIDpage, spanY);\n config.title = ATMO_PROPERTY(SigFoxIDpage, pageTitle);\n config.titleHidden = ATMO_PROPERTY(SigFoxIDpage, titleHidden);\n\tATMO_UI_SINGLEICONTEXT_Init(&config);\n\tATMO_VARIABLE(SigFoxIDpage, pageHandle) = config.templateInstance;\n ATMO_UI_SINGLEICONTEXT_SetMainText(config.templateInstance, ATMO_PROPERTY(SigFoxIDpage, label));\n ATMO_UI_SINGLEICONTEXT_SetIcon(config.templateInstance, ATMO_PROPERTY(SigFoxIDpage, icon));\n ATMO_UI_SINGLEICONTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), ATMO_ABILITY(SigFoxIDpage, onDisplayed));\n ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 1, ATMO_ABILITY(SigFoxIDpage, topRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 2, ATMO_ABILITY(SigFoxIDpage, bottomRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 3, ATMO_ABILITY(SigFoxIDpage, topLeftButtonPressed));\n ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SigFoxIDpage,pageHandle), 4, ATMO_ABILITY(SigFoxIDpage, bottomLeftButtonPressed));\n ATMO_UI_SINGLEICONTEXT_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(SigFoxIDpage, onLeave));\n\treturn ATMO_Status_Success;\n ",
"onLeave": "\n\treturn ATMO_Status_Success;\n\t",
"setLabel": "\n char label[32];\n if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n {\n ATMO_UI_SINGLEICONTEXT_SetMainText(ATMO_VARIABLE(SigFoxIDpage,pageHandle), label);\n }\n else\n {\n return ATMO_Status_Fail;\n }\n\n return ATMO_Status_Success;\n "
},
"variables": {
"pageHandle": {
"type": "ATMO_DriverInstanceHandle_t"
}
},
"embeddedPropertyConversions": {
"pageTitle": "string",
"topRightButtonLabel": "string",
"bottomRightButtonLabel": "string",
"topLeftButtonLabel": "string",
"bottomLeftButtonLabel": "string",
"label": "string"
},
"codeUserChanged": {
"displayPage": false,
"onDisplayed": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false,
"setup": false,
"onLeave": false,
"setLabel": false
},
"textColor": "GUI_GREEN",
"pageTitle": "SigFox ID",
"titleHidden": false,
"pageHidden": false,
"topRightButtonLabel": "ID",
"topRightButtonEnabled": false,
"bottomRightButtonLabel": "",
"bottomRightButtonEnabled": false,
"topLeftButtonLabel": "",
"topLeftButtonEnabled": false,
"bottomLeftButtonLabel": "",
"bottomLeftButtonEnabled": false,
"x": "1",
"y": 0,
"spanX": 1,
"spanY": 1,
"icon": "icon_settings_sensortag",
"label": "?"
},
"meta": {
"editorX": 376,
"editorY": 0,
"lastTrigger": "onDisplayed"
},
"triggers": {
"triggered": [],
"onDisplayed": [],
"topRightButtonPressed": [],
"bottomRightButtonPressed": [],
"topLeftButtonPressed": [],
"bottomLeftButtonPressed": [],
"onLeave": []
},
"interruptAbilities": {
"trigger": false,
"displayPage": false,
"onDisplayed": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false,
"setup": false,
"onLeave": false,
"setLabel": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "displayPage",
"triggers": []
},
{
"name": "onDisplayed",
"triggers": [
"onDisplayed"
]
},
{
"name": "topRightButtonPressed",
"triggers": [
"topRightButtonPressed"
]
},
{
"name": "bottomRightButtonPressed",
"triggers": [
"bottomRightButtonPressed"
]
},
{
"name": "topLeftButtonPressed",
"triggers": [
"topLeftButtonPressed"
]
},
{
"name": "bottomLeftButtonPressed",
"triggers": [
"bottomLeftButtonPressed"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "onLeave",
"triggers": [
"onLeave"
]
},
{
"name": "setLabel",
"triggers": []
}
]
},
{
"name": "IDDebugPrint",
"type": "EmbeddedDebugPrint",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"debugPrint"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\treturn ATMO_Status_Success;\n\t",
"print": "\n if((in != NULL) && (in->type != ATMO_DATATYPE_VOID))\n {\n char str[256];\n unsigned int prependLen = strlen(ATMO_PROPERTY(IDDebugPrint, prepend));\n // If there's text to prepend, do that first\n if(prependLen > 0)\n {\n sprintf(str, \"%s: \", ATMO_PROPERTY(IDDebugPrint, prepend));\n prependLen += 2; // Adding 2 chars for \": \"\n }\n \n // Grab the string version of the input data, place it after the prepend text\n if(ATMO_GetString(in, str + prependLen, 256 - prependLen) == ATMO_Status_Success)\n {\n ATMO_PLATFORM_DebugPrint(\"%s\\r\\n\", str);\n }\n }\n else\n {\n ATMO_PLATFORM_DebugPrint(\"%s\\r\\n\", ATMO_PROPERTY(IDDebugPrint, prepend));\n }\n \n return ATMO_Status_Success;\n "
},
"variables": {},
"embeddedPropertyConversions": {
"prepend": "string"
},
"codeUserChanged": {
"setup": false,
"print": false
},
"prepend": "SigFox ID: "
},
"meta": {
"editorX": 379,
"editorY": 141,
"lastTrigger": "printed"
},
"triggers": {
"triggered": [],
"printed": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"print": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "print",
"triggers": [
"printed"
]
}
]
},
{
"name": "InitialPage",
"type": "EmbeddedStaticTextDisplay",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"rpk"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(InitialPage, x), ATMO_PROPERTY(InitialPage, y), false);\n\treturn ATMO_Status_Success;\n\t",
"topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
"onDisplayed": "\n\treturn ATMO_Status_Success;\n ",
"setText": "\n ATMO_Value_t strVal;\n ATMO_InitValue(&strVal);\n ATMO_CreateValueConverted(&strVal, ATMO_DATATYPE_STRING, in);\n ATMO_UI_STATICTEXT_SetText(ATMO_VARIABLE(InitialPage,pageHandle), strVal.data);\n ATMO_FreeValue(&strVal);\n\treturn ATMO_Status_Success;\n\t",
"setup": "\n ATMO_UI_PAGE_Config_t config;\n\tconfig.hidden = ATMO_PROPERTY(InitialPage, pageHidden);\n\tconfig.textColor = ATMO_PROPERTY(InitialPage, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(InitialPage, topRightButtonEnabled),\n\t\tATMO_PROPERTY(InitialPage,bottomRightButtonEnabled), ATMO_PROPERTY(InitialPage, topLeftButtonEnabled), ATMO_PROPERTY(InitialPage, bottomLeftButtonEnabled));\n config.x = ATMO_PROPERTY(InitialPage, x);\n\tconfig.y = ATMO_PROPERTY(InitialPage, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(InitialPage, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(InitialPage, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(InitialPage, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(InitialPage, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n config.spanX = ATMO_PROPERTY(InitialPage, spanX);\n\tconfig.spanY = ATMO_PROPERTY(InitialPage, spanY);\n config.title = ATMO_PROPERTY(InitialPage, pageTitle);\n config.titleHidden = ATMO_PROPERTY(InitialPage, titleHidden);\n\tATMO_UI_STATICTEXT_Init(&config);\n\tATMO_VARIABLE(InitialPage, pageHandle) = config.templateInstance;\n ATMO_UI_STATICTEXT_SetText(config.templateInstance, ATMO_PROPERTY(InitialPage, text));\n\tATMO_UI_STATICTEXT_SetTextSize(config.templateInstance, ATMO_PROPERTY(InitialPage, fontSize));\n\tATMO_UI_STATICTEXT_SetAlignment(config.templateInstance, ATMO_PROPERTY(InitialPage, horizontalAlignment));\n\tATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 1, ATMO_ABILITY(InitialPage, topRightButtonPressed));\n\tATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 2, ATMO_ABILITY(InitialPage, bottomRightButtonPressed));\n\tATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 3, ATMO_ABILITY(InitialPage, topLeftButtonPressed));\n ATMO_UI_STATICTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), 4, ATMO_ABILITY(InitialPage, bottomLeftButtonPressed));\n \n\tif(!config.hidden)\n\t{\n\t\tATMO_UI_STATICTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(InitialPage,pageHandle), ATMO_ABILITY(InitialPage, onDisplayed));\n\t}\n return ATMO_Status_Success;\n "
},
"variables": {
"pageHandle": {
"type": "ATMO_DriverInstanceHandle_t"
}
},
"embeddedPropertyConversions": {
"pageTitle": "string",
"topRightButtonLabel": "string",
"bottomRightButtonLabel": "string",
"topLeftButtonLabel": "string",
"bottomLeftButtonLabel": "string",
"text": "string"
},
"codeUserChanged": {
"displayPage": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false,
"onDisplayed": false,
"setText": false,
"setup": false
},
"textColor": "GUI_RED",
"pageTitle": "SigFox Inspector",
"titleHidden": false,
"pageHidden": false,
"topRightButtonLabel": "ID",
"topRightButtonEnabled": true,
"bottomRightButtonLabel": "",
"bottomRightButtonEnabled": false,
"topLeftButtonLabel": "PAC",
"topLeftButtonEnabled": false,
"bottomLeftButtonLabel": "",
"bottomLeftButtonEnabled": false,
"x": 0,
"y": 0,
"spanX": 1,
"spanY": 1,
"text": "Retrieves Sigfox ID",
"fontSize": "ATMO_FONT_SIZE_20PT",
"horizontalAlignment": "GUI_TA_HCENTER"
},
"meta": {
"editorX": 12,
"editorY": 0,
"lastTrigger": "onDisplayed"
},
"triggers": {
"triggered": [],
"topRightButtonPressed": [],
"bottomRightButtonPressed": [],
"topLeftButtonPressed": [],
"bottomLeftButtonPressed": [],
"onDisplayed": []
},
"interruptAbilities": {
"trigger": false,
"displayPage": false,
"topRightButtonPressed": false,
"bottomRightButtonPressed": false,
"topLeftButtonPressed": false,
"bottomLeftButtonPressed": false,
"onDisplayed": false,
"setText": false,
"setup": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "displayPage",
"triggers": []
},
{
"name": "topRightButtonPressed",
"triggers": [
"topRightButtonPressed"
]
},
{
"name": "bottomRightButtonPressed",
"triggers": [
"bottomRightButtonPressed"
]
},
{
"name": "topLeftButtonPressed",
"triggers": [
"topLeftButtonPressed"
]
},
{
"name": "bottomLeftButtonPressed",
"triggers": [
"bottomLeftButtonPressed"
]
},
{
"name": "onDisplayed",
"triggers": [
"onDisplayed"
]
},
{
"name": "setText",
"triggers": []
},
{
"name": "setup",
"triggers": []
}
]
},
{
"name": "LEDresetInterval",
"type": "EmbeddedInterval",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_INTERVAL_Handle_t intervalHandle;\n ATMO_INTERVAL_AddAbilityInterval(\n\t\tATMO_PROPERTY(LEDresetInterval, instance), \n\t\tATMO_ABILITY(LEDresetInterval, interval), \n\t\tATMO_PROPERTY(LEDresetInterval, time), \n\t\t&intervalHandle\n\t);\n\t\n\treturn ATMO_Status_Success;\n\t",
"interval": "\treturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"interval": false
},
"instance": "ATMO_DRIVERINSTANCE_INTERVAL_INTERVAL1",
"time": "2000"
},
"meta": {
"editorX": 127,
"editorY": 191,
"lastTrigger": "interval"
},
"triggers": {
"triggered": [],
"interval": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "RGBLed",
"targetAbility": "setOff"
}
]
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"interval": true
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "interval",
"triggers": [
"interval"
]
}
]
},
{
"name": "RightTouch",
"type": "EmbeddedSX9500",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\tATMO_SX9500_Config_t config;\n\tconfig.address = ATMO_PROPERTY(RightTouch, i2cAddress);\n\tconfig.i2cDriverInstance = ATMO_PROPERTY(RightTouch, i2cInstance);\n\tconfig.gpioDriverInstance = ATMO_PROPERTY(RightTouch, gpioInstance);\n\tconfig.interruptEnabled = ATMO_PROPERTY(RightTouch, interruptEnabled);\n\tconfig.interruptPin = ATMO_PROPERTY(RightTouch, interruptGpio);\n\tATMO_SX9500_Init(&config);\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Up, ATMO_ABILITY(RightTouch, pressUp));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Down, ATMO_ABILITY(RightTouch, pressDown));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Left, ATMO_ABILITY(RightTouch, pressLeft));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Right, ATMO_ABILITY(RightTouch, pressRight));\n\treturn ATMO_Status_Success;",
"getTouchData": "",
"pressUp": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
"pressDown": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
"pressLeft": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
"pressRight": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"getTouchData": false,
"pressUp": false,
"pressDown": false,
"pressLeft": false,
"pressRight": false
},
"i2cInstance": "ATMO_DRIVERINSTANCE_I2C_I2C2",
"gpioInstance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
"interruptEnabled": true,
"interruptGpio": "PTA9",
"i2cAddress": "0x28"
},
"meta": {
"editorX": 14,
"editorY": 94,
"lastTrigger": "rightPressed"
},
"triggers": {
"triggered": [],
"touchDataRead": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "TopRightButton",
"targetAbility": "topRightPushed"
}
],
"upPressed": [],
"downPressed": [],
"leftPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "TopRightButton",
"targetAbility": "topRightPushed"
}
],
"rightPressed": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "TopRightButton",
"targetAbility": "topRightPushed"
}
]
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"getTouchData": false,
"pressUp": false,
"pressDown": false,
"pressLeft": false,
"pressRight": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "getTouchData",
"triggers": [
"touchDataRead"
]
},
{
"name": "pressUp",
"triggers": [
"upPressed",
"touchDataRead"
]
},
{
"name": "pressDown",
"triggers": [
"downPressed",
"touchDataRead"
]
},
{
"name": "pressLeft",
"triggers": [
"leftPressed",
"touchDataRead"
]
},
{
"name": "pressRight",
"triggers": [
...
This file has been truncated, please download it to see its full contents.
Comments