-
-
Save w-i-n-s/b0bcfb588f587bbb3683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BLE_API_VERSION "1.07" //**<version of firmware for app interaction>**// | |
const int ble_api_keys_count = 30; | |
const char *ble_api_keys[]={ //ad meand app->device | |
"cb_", //00 ad connect begin | |
"cr%i_", //01 da send request secure number | |
"ca%i_", //02 ad answer for secure and hope for connect success | |
"cnok_", //03 da connection not success, disconnect. In another case - return version of device | |
"v_%S_", //04 da version from device to app, means also connection is begin | |
"rp_%i_", //05 ad post rtc value | |
"rok_%i_", //06 da notification that rtc value receives correctly and send old time | |
"rnok_", //07 da setting rtc is not success | |
"sg_" //08 ad get all schedule items (UNUSED) | |
"sp_", //09 ad/da post schedule all items/mark answer for sg_ before send all items | |
"sa_%02i_%05i_%i_%05i_", //10 ad/da add schedule item (number_seconds_mode_angle) | |
"se_%02i_%05i_%i_%05i_", //11 ad edit schedule item (number_seconds_mode_angle) | |
"sd_%02i_", //12 ad delete schedule item (item number) | |
"sok_%02i_", //13 da operation with item ok | |
"snok_%02i_", //14 da operation with item not ok | |
"mg_", //15 ad request for measurement app->device | |
"i%i_o%i_t%i_", //16 da indoor, outdoor, temperature "i23.o45.t22." | |
"b%i_a%i_m%i_", //17 da battery, angle, mode "b4.a16000.m1." | |
"mok_", //18 ad app receive measurements correctly | |
"ac_", //19 ad clean angle to initial value | |
"ai_", //20 ad go to initial value | |
"as_%i_", //21 ad send new angle "a5500." | |
"aok_%d_", //22 da receive angle and move to position | |
"lg_", //23 ad ask for preferred light value | |
"ls_%i_", //24 ad/da Set/answer preferred light indoors (0-255) | |
"lok_%i_", //25 ad/da Set preferred light successfully | |
"tg_", //27 ad ask for preferred temperature | |
"ts_%i_", //28 ad/da Set/answer preferred temperature (0-255) | |
"tok_%i_", //29 ad/da Set preferred temperature successfully | |
"alg:%02i:%02i:%02i", // 30 Shows when algorythm of checking device was started | |
"algsk_%02i:%02i:%02i"// 31 Shows that algorythm skeep checking because of did connected | |
/* | |
"n." | |
"nok." | |
"gid%i." | |
"gidok." | |
"gn%@." | |
"gnok" | |
*/ | |
}; | |
typedef enum { | |
BAR_CONNECTION_BEGIN = 0, | |
BAR_CONNECTION_REQUEST, | |
BAR_CONNECTION_ANSWER, | |
BAR_CONNECTION_NOK, | |
BAR_VERSION, | |
BAR_RTC_SET, | |
BAR_RTC_OK, | |
BAR_RTC_NOK, | |
BAR_SCH_GET, | |
BAR_SCH_ITEM, | |
BAR_SCH_POST, | |
BAR_SCH_ADD, | |
BAR_SCH_EDIT, | |
BAR_SCH_DELETE, | |
BAR_MEAS_GET, | |
BAR_MEAS_IOT, | |
BAR_MEAS_BAM, | |
BAR_MEAS_OK, | |
BAR_ANGLE_CLEAN, | |
BAR_ANGLE_INIT, | |
BAR_ANGLE_SET, | |
BAR_ANGLE_OK, | |
BAR_PR_LIGHT_GET, | |
BAR_PR_LIGHT_SET, | |
BAR_PR_LIGHT_OK, | |
BAR_PR_TEMP_GET, | |
BAR_PR_TEMP_SET, | |
BAR_PR_TEMP_OK | |
} ble_api_request_t; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment