Update PV_BLE_cover.ino
add default ACK for unknown messages
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
#define NAME "myPVcover"
|
#define NAME "myPVcover"
|
||||||
const uint16_t SW_VERSION = 391;
|
const uint16_t SW_VERSION = 391;
|
||||||
const char *SERIAL_NR = "01234567890ABCDEF";
|
const char *SERIAL_NR = "01234567890ABCDEF";
|
||||||
const uint16_t TYP_ID = 62;
|
const uint16_t TYP_ID = 42; // 62
|
||||||
const uint16_t MODEL_ID = 224;
|
const uint16_t MODEL_ID = 224;
|
||||||
const uint16_t FW_REVISION = 27;
|
const uint16_t FW_REVISION = 27;
|
||||||
const uint32_t HW_REVISION = 171103;
|
const uint32_t HW_REVISION = 171103;
|
||||||
@@ -259,7 +259,9 @@ void decode(BLECharacteristic *pChar) {
|
|||||||
resp_size = set_response(&response, (const message *)data_dec);
|
resp_size = set_response(&response, (const message *)data_dec);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Serial.println(F("*********************************** unknown message"));
|
Serial.println(F("*********************************** unknown message (try ACK)"));
|
||||||
|
resp_size = set_response(&response, (const message *)data_dec);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (resp_size) {
|
if (resp_size) {
|
||||||
pChar->setValue((uint8_t *)&response, resp_size);
|
pChar->setValue((uint8_t *)&response, resp_size);
|
||||||
@@ -349,6 +351,7 @@ class genericCallbacks : public BLECharacteristicCallbacks {
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
delay(1000); // wait for terminal to be ready
|
||||||
Serial.println(NAME " initializing ...");
|
Serial.println(NAME " initializing ...");
|
||||||
|
|
||||||
BLEDevice::init(NAME);
|
BLEDevice::init(NAME);
|
||||||
@@ -437,7 +440,7 @@ pDesc1->setValue("cover");*/
|
|||||||
|
|
||||||
// Start advertising
|
// Start advertising
|
||||||
BLEAdvertisementData AdvertisementData;
|
BLEAdvertisementData AdvertisementData;
|
||||||
const char adv[] = {0x19, 0x08, 0x00, 0x00, TYP_ID, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2};
|
const char adv[] = { 0x19, 0x08, 0x00, 0x00, TYP_ID, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA2 };
|
||||||
// Hunter Douglas ^^ -- ^^ ^^key ^^ ^--pos1--^
|
// Hunter Douglas ^^ -- ^^ ^^key ^^ ^--pos1--^
|
||||||
|
|
||||||
AdvertisementData.setManufacturerData(String(adv, 11));
|
AdvertisementData.setManufacturerData(String(adv, 11));
|
||||||
|
|||||||
Reference in New Issue
Block a user