Commit 56c0525a authored by Vasek Hanák's avatar Vasek Hanák

Backup/Restore, Read/Write TrConf and EnumerateDevice services API update

parent 744fc1bd
Pipeline #3773 passed with stages
in 47 minutes and 14 seconds
......@@ -44,7 +44,7 @@
"type": "boolean",
"description": "Device online status."
},
"MID": {
"mid": {
"type": "integer",
"description": "Device MID."
},
......
......@@ -347,7 +347,7 @@
"type": "integer",
"description": "A nonzero value specifies an alternative DPA service mode channel."
},
"localFRCreception": {
"localFrcReception": {
"type": "boolean",
"description": "If set, then Local FRC reception is enabled at [N]."
},
......
......@@ -176,7 +176,7 @@
"type": "integer",
"description": "Baud rate of the UART interface if one is used."
},
"localFRCreception": {
"localFrcReception": {
"type": "boolean",
"description": "If set, then Local FRC reception is enabled at [N]."
},
......
......@@ -141,7 +141,7 @@
"type": "integer",
"description": "A nonzero value specifies an alternative DPA service mode channel."
},
"localFRCreception": {
"localFrcReception": {
"type": "boolean",
"description": "If set, then Local FRC reception is enabled at [N]."
},
......
......@@ -71,7 +71,7 @@ namespace iqrf {
if (deviceBackupData.getOnlineStatus() == true)
{
// Put MID
objDeviceBackup.AddMember("MID", deviceBackupData.getMID(), allocator);
objDeviceBackup.AddMember("mid", deviceBackupData.getMid(), allocator);
// Put DPA version
objDeviceBackup.AddMember("dpaVer", deviceBackupData.getDpaVersion() & 0x3fff, allocator);
// Put backup data
......
......@@ -878,11 +878,11 @@ namespace iqrf {
// for DPA >= v4.15
if (dpaVer >= 0x0415)
{
// localFRCreception at [N] only
// localFrcReception at [N] only
if (deviceEnumerateResult.getDeviceAddr() != COORDINATOR_ADDRESS)
{
bool localFRCreception = ((configuration[0x0c] & 0b00000001) == 0b00000001);
Pointer("/data/rsp/trConfiguration/localFRCreception").Set(response, localFRCreception);
bool localFrcReception = ((configuration[0x0c] & 0b00000001) == 0b00000001);
Pointer("/data/rsp/trConfiguration/localFrcReception").Set(response, localFrcReception);
}
}
......
......@@ -485,11 +485,11 @@ namespace iqrf {
// for DPA >= v4.15
if (dpaVer >= 0x0415)
{
// localFRCreception at [N] only
// localFrcReception at [N] only
if (deviceAddr != COORDINATOR_ADDRESS)
{
bool localFRCreception = ((configuration[0x0c] & 0b00000001) == 0b00000001);
Pointer("/data/rsp/localFRCreception").Set(response, localFRCreception);
bool localFrcReception = ((configuration[0x0c] & 0b00000001) == 0b00000001);
Pointer("/data/rsp/localFrcReception").Set(response, localFrcReception);
}
}
......
......@@ -74,7 +74,7 @@ namespace iqrf {
// DPA configuration bits #1
struct
{
bool localFRCreception;
bool localFrcReception;
uint8_t mask;
uint8_t value;
}dpaConfigBits_1;
......@@ -332,11 +332,11 @@ namespace iqrf {
if ( (jsonVal = rapidjson::Pointer( "/data/req/rfAltDsmChannel" ).Get( doc )) )
m_writeTrConfParams.rfSettings.rfAltDsmChannel = jsonVal->GetInt();
// localFRCreception
if ((jsonVal = rapidjson::Pointer("/data/req/localFRCreception").Get(doc)))
// localFrcReception
if ((jsonVal = rapidjson::Pointer("/data/req/localFrcReception").Get(doc)))
{
m_writeTrConfParams.dpaConfigBits_1.localFRCreception = jsonVal->GetBool();
if (m_writeTrConfParams.dpaConfigBits_1.localFRCreception == true)
m_writeTrConfParams.dpaConfigBits_1.localFrcReception = jsonVal->GetBool();
if (m_writeTrConfParams.dpaConfigBits_1.localFrcReception == true)
m_writeTrConfParams.dpaConfigBits_1.value = 0x01;
m_writeTrConfParams.dpaConfigBits_1.mask = 0x01;
}
......
......@@ -752,7 +752,7 @@ namespace iqrf
// DPA configuration bits #1 for DPA > 4.14
if (coordEnum.DpaVersion > 0x0414)
{
// DPA configuration bits #1 (address 0x0d) - bit0 localFRCreception [N] only
// DPA configuration bits #1 (address 0x0d) - bit0 localFrcReception [N] only
if ((m_writeTrConfParams.deviceAddress != COORDINATOR_ADDRESS) && (m_writeTrConfParams.dpaConfigBits_1.mask == 0x01))
{
TrConfigByte dpaConfigBits_1(0x0d, m_writeTrConfParams.dpaConfigBits_1.value, m_writeTrConfParams.dpaConfigBits_1.mask);
......
......@@ -24,7 +24,7 @@ namespace iqrf {
private:
uint16_t m_address;
bool m_online;
uint32_t m_MID;
uint32_t m_mid;
uint16_t m_dpaVersion;
std::basic_string<uint8_t> m_data;
......@@ -32,15 +32,15 @@ namespace iqrf {
DeviceBackupData()
: m_address(0),
m_online(false),
m_MID(0),
m_mid(0),
m_dpaVersion(0)
{
}
DeviceBackupData(const uint16_t address, const bool online, const uint32_t MID, const uint16_t dpaVersion, const std::basic_string<uint8_t> &data)
DeviceBackupData(const uint16_t address, const bool online, const uint32_t mid, const uint16_t dpaVersion, const std::basic_string<uint8_t> &data)
: m_address(address),
m_online(online),
m_MID(MID),
m_mid(mid),
m_dpaVersion(dpaVersion),
m_data(data)
{
......@@ -49,7 +49,7 @@ namespace iqrf {
DeviceBackupData(const uint16_t address)
: m_address(address),
m_online(false),
m_MID(0),
m_mid(0),
m_dpaVersion(0)
{
}
......@@ -60,7 +60,7 @@ namespace iqrf {
}
bool getOnlineStatus() const { return m_online; }
uint32_t getMID() const { return m_MID; }
uint32_t getMid() const { return m_mid; }
uint16_t getDpaVersion() const { return m_dpaVersion; }
std::basic_string<uint8_t> getBackupData() const { return m_data; }
......@@ -74,9 +74,9 @@ namespace iqrf {
m_online = online;
}
void setMID(const uint32_t MID)
void setMid(const uint32_t mid)
{
m_MID = MID;
m_mid = mid;
}
void setDpaVersion(uint16_t dpaVersion)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment