diff --git a/docs/devices/FEASY.MD b/docs/devices/FEASY.MD new file mode 100644 index 00000000..238f5961 --- /dev/null +++ b/docs/devices/FEASY.MD @@ -0,0 +1,13 @@ +# Feasycom Bluetooth Beacon + +|Model Id|[FEASY](https://github.com/theengs/decoder/blob/development/src/devices/FEASY_json.h)| +|-|-| +|Brand|Feasycom| +|Model|Bluetooth Beacon| +|Short Description|Various types of Bluetooth beacons| +|Communication|BLE broadcast| +|Frequency|2.4Ghz| +|Power Source|different batteries depending on type or USB| +|Exchanged Data|beacon model, battery, plugged-in (true for USB powered beacons)| +|Encrypted|No| +|Device Tracker|✅| diff --git a/src/decoder.h b/src/decoder.h index 268d7e79..9e1c0c9b 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -112,6 +112,7 @@ class TheengsDecoder { BM3IN1, BM4IN1, MS_CDP, + FEASY, GAEN, HHCCPOT002, BPARASITE, diff --git a/src/devices.h b/src/devices.h index 54f19003..78941ff9 100644 --- a/src/devices.h +++ b/src/devices.h @@ -27,6 +27,7 @@ #include "devices/CGP1W_json.h" #include "devices/CGP23W_json.h" #include "devices/CGPR1_json.h" +#include "devices/FEASY_json.h" #include "devices/GAEN_json.h" #include "devices/H5055_json.h" #include "devices/H5072_json.h" @@ -180,6 +181,7 @@ const char* _devices[][2] = { {_BM3IN1_json, _BM3IN1_json_props}, {_BM4IN1_json, _BM4IN1_json_props}, {_MS_CDP_json, _MS_CDP_json_props}, + {_FEASY_json, _FEASY_json_props}, {_GAEN_json, _GAEN_json_props}, {_HHCCPOT002_json, _HHCCPOT002_json_props}, {_BPARASITE_json, _BPARASITE_json_props}, diff --git a/src/devices/FEASY_json.h b/src/devices/FEASY_json.h new file mode 100644 index 00000000..a8f20560 --- /dev/null +++ b/src/devices/FEASY_json.h @@ -0,0 +1,63 @@ +const char* _FEASY_json = "{\"brand\":\"Feasycom\",\"model\":\"Beacon\",\"model_id\":\"FEASY\",\"tag\":\"0608\",\"condition\":[\"servicedata\",\"=\",22,\"&\",\"uuid\",\"index\",0,\"fff0\"],\"properties\":{\"beaconmodel\":{\"decoder\":[\"string_from_hex_data\",\"servicedata\",0,2,false,false],\"lookup\":[\"19\",\"BP109\",\"1a\",\"BP103\",\"1b\",\"BP104\",\"1c\",\"BP201\",\"1d\",\"BP106\",\"1e\",\"BP101\",\"24\",\"BP120\",\"27\",\"BP108\",\"28\",\"BP108N\"]},\"batt\":{\"condition\":[\"servicedata\",20,\"!\",\"65\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",20,2,false,false],\"post_proc\":[\"&\",127]},\"plugged-in\":{\"condition\":[\"servicedata\",20,\"65\"],\"decoder\":[\"static_value\",true]},\"_plugged-in\":{\"condition\":[\"servicedata\",20,\"!\",\"65\"],\"decoder\":[\"static_value\",false]},\"mac\":{\"decoder\":[\"mac_from_hex_data\",\"servicedata\",8]}}}"; + +/*R""""( +{ + "brand":"Feasycom", + "model":"Beacon", + "model_id":"FEASY", + "tag":"0608", + "condition":["servicedata", "=", 22, "&", "uuid", "index", 0, "fff0"], + "properties":{ + "beaconmodel":{ + "decoder":["string_from_hex_data", "servicedata", 0, 2, false, false], + "lookup":["19", "BP109", + "1a", "BP103", + "1b", "BP104", + "1c", "BP201", + "1d", "BP106", + "1e", "BP101", + "24", "BP120", + "27", "BP108", + "28", "BP108N"] + }, + "batt":{ + "condition":["servicedata", 20, "!", "65"], + "decoder":["value_from_hex_data", "servicedata", 20, 2, false, false], + "post_proc":["&", 127] + }, + "plugged-in":{ + "condition":["servicedata", 20, "65"], + "decoder":["static_value", true] + }, + "_plugged-in":{ + "condition":["servicedata", 20, "!", "65"], + "decoder":["static_value", false] + }, + "mac":{ + "decoder":["mac_from_hex_data", "servicedata", 8] + } + } +})"""";*/ + +const char* _FEASY_json_props = "{\"properties\":{\"beaconmodel\":{\"unit\":\"string\",\"name\":\"beacon model\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"},\"plugged-in\":{\"unit\":\"status\",\"name\":\"plug\"},\"mac\":{\"unit\":\"string\",\"name\":\"MAC address\"}}}"; +/*R""""( +{ + "properties":{ + "beaconmodel":{ + "unit":"string", + "name":"beacon model" + }, + "batt":{ + "unit":"%", + "name":"battery" + }, + "plugged-in":{ + "unit":"status", + "name":"plug" + }, + "mac":{ + "unit":"string", + "name":"MAC address" + } + } +})"""";*/ diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index 9740488a..5542bfd5 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -354,6 +354,7 @@ const char* expected_uuid[] = { "{\"brand\":\"NodOn\",\"model\":\"NIU smart button\",\"model_id\":\"NODONNIU\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"track\":true,\"button\":9,\"color\":\"Lagoon\",\"batt\":96}", "{\"brand\":\"NodOn\",\"model\":\"NIU smart button\",\"model_id\":\"NODONNIU\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"track\":true,\"button\":10,\"color\":\"Lagoon\",\"batt\":98}", "{\"brand\":\"NodOn\",\"model\":\"NIU smart button\",\"model_id\":\"NODONNIU\",\"type\":\"BTN\",\"acts\":true,\"cont\":true,\"track\":true,\"button\":3,\"color\":\"CozyGrey\",\"batt\":89}", + "{\"brand\":\"Feasycom\",\"model\":\"Beacon\",\"model_id\":\"FEASY\",\"type\":\"BCON\",\"track\":true,\"beaconmodel\":\"BP108\",\"batt\":100,\"plugged-in\":false,\"mac\":\"AA:BB:CC:DD:EE:FF\"}", }; const char* expected_mac_mfg[] = { @@ -967,6 +968,7 @@ const char* test_uuid[][4] = { {"NodOn NIU", "0x0000", "servicedata", "02599c37d90287a52152000660259003"}, {"NodOn NIU", "0x0000", "servicedata", "02599c37d90287a521520006622b8104"}, {"NodOn NIU", "0x0000", "servicedata", "02599c37d90287a521520004595eb905"}, + {"Feasycom BP108", "0xfff0", "servicedata", "27021992aabbccddeeff64"}, }; TheengsDecoder::BLE_ID_NUM test_uuid_id_num[]{ @@ -1101,6 +1103,7 @@ TheengsDecoder::BLE_ID_NUM test_uuid_id_num[]{ TheengsDecoder::BLE_ID_NUM::NODONNIU, TheengsDecoder::BLE_ID_NUM::NODONNIU, TheengsDecoder::BLE_ID_NUM::NODONNIU, + TheengsDecoder::BLE_ID_NUM::FEASY, }; // MAC manufacturer data test input [test name] [mac] [data]