Commit 5d18caa3 authored by Vasek Hanák's avatar Vasek Hanák

Read/WriteTrConf and EnumerationDevice - localFRCreception added

parent d68fa791
Pipeline #3759 passed with stages
in 30 minutes and 52 seconds
......@@ -347,6 +347,10 @@
"type": "integer",
"description": "A nonzero value specifies an alternative DPA service mode channel."
},
"localFRCreception": {
"type": "boolean",
"description": "If set, then Local FRC reception is enabled at [N]."
},
"rfPgmEnableAfterReset": {
"type": "boolean",
"description": "If sets, then activates RFPGM invoking by TR module reset."
......
{
"$schema": "https://apidocs.iqrf.org/iqrf-gateway-daemon/latest/com.iqrftech.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.iqrftech.self-desc",
"name": "iqmeshNetwork_ReadTrConf-response",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"mType": {
"type": "string",
"description": "IQMESH Network management - Read TR configuration response.",
"enum": [
"iqmeshNetwork_ReadTrConf"
]
},
"data": {
"type": "object",
"properties": {
"msgId": {
"type": "string",
"description": "Message identification for binding request with response."
},
"rsp": {
"type": "object",
"description": "Returns following values, see its description.",
"properties": {
"deviceAddr": {
"type": "integer",
"description": "Device address to read the configuration from."
},
"embPers": {
"type": "object",
"description": "Embedded peripherals enabled on the node.",
"properties": {
"values": {
"type": "array",
"description": "An array of 32 bits. Each bit enables/disables one of the embedded 32 predefined peripherals.",
"items": {
"type": "integer"
},
"maxItems": 4
},
"coordinator": {
"type": "boolean",
"description": "If coordinator is enabled."
},
"node": {
"type": "boolean",
"description": "If node is enabled."
},
"os": {
"type": "boolean",
"description": "If OS is enabled."
},
"eeprom": {
"type": "boolean",
"description": "If EEPROM is enabled."
},
"eeeprom": {
"type": "boolean",
"description": "If EEEPROM is enabled."
},
"ram": {
"type": "boolean",
"description": "If RAM is enabled."
},
"ledr": {
"type": "boolean",
"description": "If LEDR is enabled."
},
"ledg": {
"type": "boolean",
"description": "If LEDG is enabled."
},
"spi": {
"type": "boolean",
"description": "If SPI is enabled."
},
"io": {
"type": "boolean",
"description": "If IO is enabled."
},
"thermometer": {
"type": "boolean",
"description": "If thermometer is enabled."
},
"pwm": {
"type": "boolean",
"description": "If PWM is enabled."
},
"uart": {
"type": "boolean",
"description": "If UART is enabled."
},
"frc": {
"type": "boolean",
"description": "If FRC is enabled."
}
}
},
"rfBand": {
"type": "string",
"description": "Used RF band."
},
"rfChannelA": {
"type": "integer",
"description": "Main RF channel A of the main network. Valid numbers depend on used RF band."
},
"rfChannelB": {
"type": "integer",
"description": "Same as above but second B channel. Used at RFPGM only."
},
"rfSubChannelA": {
"type": "integer",
"description": "Main RF channel A of the optional subordinate network in case the node also plays a role of the coordinator of such network. Valid numbers depend on used RF band. Available for DPA<400."
},
"rfSubChannelB": {
"type": "integer",
"description": "Same as above but second B channel."
},
"txPower": {
"type": "integer",
"description": "RF output power. Valid numbers 0-7."
},
"rxFilter": {
"type": "integer",
"description": "RF signal filter. Valid numbers 0-64."
},
"lpRxTimeout": {
"type": "integer",
"description": "Timeout for receiving RF packets at LP mode at N device."
},
"rfAltDsmChannel": {
"type": "integer",
"description": "A nonzero value specifies an alternative DPA service mode channel."
},
"rfPgmEnableAfterReset": {
"type": "boolean",
"description": "If sets, then activates RFPGM invoking by TR module reset."
},
"rfPgmTerminateAfter1Min": {
"type": "boolean",
"description": "If sets, then terminates RFPGM automatically ~1 minute after reset."
},
"rfPgmTerminateMcuPin": {
"type": "boolean",
"description": "If sets, then terminates RFPGM by dedicated pin of the TR module."
},
"rfPgmDualChannel": {
"type": "boolean",
"description": "If sets, then enables single or dual channel function."
},
"rfPgmLpMode": {
"type": "boolean",
"description": "RFPGM receiving mode setting. If set, then LP (low power) Rx mode is used during RFPGM. Otherwise STD (standard) Rx mode is used."
},
"rfPgmIncorrectUpload": {
"type": "boolean",
"description": "Read only. Indicates that the last RFPGM has successfully been completed."
},
"customDpaHandler": {
"type": "boolean",
"description": "If set, then a Custom DPA handler is called in case of an event."
},
"dpaPeerToPeer": {
"type": "boolean",
"description": "If set, then DP2P is enabled at [N]."
},
"nodeDpaInterface": {
"type": "boolean",
"description": "If set, then Node device can be controlled by a SPI or UART interface. Valid only in DPA version < 4.00"
},
"uartBaudrate": {
"type": "integer",
"description": "Baud rate of the UART interface if one is used."
},
"dpaAutoexec": {
"type": "boolean",
"description": "If set, then DPA Autoexec is run at a later stage of the module boot time."
},
"routingOff": {
"type": "boolean",
"description": "If set, then the Node device does not route packets on the background."
},
"ioSetup": {
"type": "boolean",
"description": "If set, then DPA IO Setup is run at an early stage of the module boot time."
},
"peerToPeer": {
"type": "boolean",
"description": "If set, then device receives also peer-to-peer (non-networking) packets and raises PeerToPeer event."
},
"neverSleep": {
"type": "boolean",
"description": "If set, then unbonded Node using default IQRF buttons never sleeps during the button bonding. From DPA v3.03"
},
"stdAndLpNetwork": {
"type": "boolean",
"description": "If the bit is set, then the [C] controls the STD+LP network; otherwise, it controls the STD network. The bit can only be changed if the network is empty (no [Ns] are bonded) otherwise the network will stop working. From DPA v4.00"
}
},
"required": [
"deviceAddr"
]
},
"raw": {
"type": "array",
"description": "Returns array of objects req-cnf-rsp, see its description.",
"items": {
"type": "object",
"properties": {
"request": {
"type": "string",
"description": "Binary buffer with DPA request."
},
"requestTs": {
"type": "string",
"description": "YYYY-MM-DDTHH:MM:SS.SSS±HH:MM"
},
"confirmation": {
"type": "string",
"description": "Binary buffer with DPA confirmation."
},
"confirmationTs": {
"type": "string",
"description": "YYYY-MM-DDTHH:MM:SS.SSS±HH:MM"
},
"response": {
"type": "string",
"description": "Binary buffer with DPA response."
},
"responseTs": {
"type": "string",
"description": "YYYY-MM-DDTHH:MM:SS.SSS±HH:MM"
}
},
"required": [
"request",
"requestTs",
"confirmation",
"confirmationTs",
"response",
"responseTs"
]
}
},
"insId": {
"type": "string",
"description": "IQRF GW daemon instance identification."
},
"status": {
"type": "integer",
"description": "IQRF GW daemon API (general or mType) status."
},
"statusStr": {
"type": "string",
"description": "IQRF GW daemon API (general or mType) status in string form."
}
},
"required": [
"msgId",
"status"
]
}
},
"required": [
"mType",
"data"
]
"$schema": "https://apidocs.iqrf.org/iqrf-gateway-daemon/latest/com.iqrftech.self-desc/schema/jsonschema/1-0-0#",
"self": {
"vendor": "com.iqrftech.self-desc",
"name": "iqmeshNetwork_ReadTrConf-response",
"format": "jsonschema",
"version": "1-0-0"
},
"type": "object",
"properties": {
"mType": {
"type": "string",
"description": "IQMESH Network management - Read TR configuration response.",
"enum": [
"iqmeshNetwork_ReadTrConf"
]
},
"data": {
"type": "object",
"properties": {
"msgId": {
"type": "string",
"description": "Message identification for binding request with response."
},
"rsp": {
"type": "object",
"description": "Returns following values, see its description.",
"properties": {
"deviceAddr": {
"type": "integer",
"description": "Device address to read the configuration from."
},
"embPers": {
"type": "object",
"description": "Embedded peripherals enabled on the node.",
"properties": {
"values": {
"type": "array",
"description": "An array of 32 bits. Each bit enables/disables one of the embedded 32 predefined peripherals.",
"items": {
"type": "integer"
},
"maxItems": 4
},
"coordinator": {
"type": "boolean",
"description": "If coordinator is enabled."
},
"node": {
"type": "boolean",
"description": "If node is enabled."
},
"os": {
"type": "boolean",
"description": "If OS is enabled."
},
"eeprom": {
"type": "boolean",
"description": "If EEPROM is enabled."
},
"eeeprom": {
"type": "boolean",
"description": "If EEEPROM is enabled."
},
"ram": {
"type": "boolean",
"description": "If RAM is enabled."
},
"ledr": {
"type": "boolean",
"description": "If LEDR is enabled."
},
"ledg": {
"type": "boolean",
"description": "If LEDG is enabled."
},
"spi": {
"type": "boolean",
"description": "If SPI is enabled."
},
"io": {
"type": "boolean",
"description": "If IO is enabled."
},
"thermometer": {
"type": "boolean",
"description": "If thermometer is enabled."
},
"pwm": {
"type": "boolean",
"description": "If PWM is enabled."
},
"uart": {
"type": "boolean",
"description": "If UART is enabled."
},
"frc": {
"type": "boolean",
"description": "If FRC is enabled."
}
}
},
"rfBand": {
"type": "string",
"description": "Used RF band."
},
"rfChannelA": {
"type": "integer",
"description": "Main RF channel A of the main network. Valid numbers depend on used RF band."
},
"rfChannelB": {
"type": "integer",
"description": "Same as above but second B channel. Used at RFPGM only."
},
"rfSubChannelA": {
"type": "integer",
"description": "Main RF channel A of the optional subordinate network in case the node also plays a role of the coordinator of such network. Valid numbers depend on used RF band. Available for DPA<400."
},
"rfSubChannelB": {
"type": "integer",
"description": "Same as above but second B channel."
},
"txPower": {
"type": "integer",
"description": "RF output power. Valid numbers 0-7."
},
"rxFilter": {
"type": "integer",
"description": "RF signal filter. Valid numbers 0-64."
},
"lpRxTimeout": {
"type": "integer",
"description": "Timeout for receiving RF packets at LP mode at N device."
},
"rfAltDsmChannel": {
"type": "integer",
"description": "A nonzero value specifies an alternative DPA service mode channel."
},
"rfPgmEnableAfterReset": {
"type": "boolean",
"description": "If sets, then activates RFPGM invoking by TR module reset."
},
"rfPgmTerminateAfter1Min": {
"type": "boolean",
"description": "If sets, then terminates RFPGM automatically ~1 minute after reset."
},
"rfPgmTerminateMcuPin": {
"type": "boolean",
"description": "If sets, then terminates RFPGM by dedicated pin of the TR module."
},
"rfPgmDualChannel": {
"type": "boolean",
"description": "If sets, then enables single or dual channel function."
},
"rfPgmLpMode": {
"type": "boolean",
"description": "RFPGM receiving mode setting. If set, then LP (low power) Rx mode is used during RFPGM. Otherwise STD (standard) Rx mode is used."
},
"rfPgmIncorrectUpload": {
"type": "boolean",
"description": "Read only. Indicates that the last RFPGM has successfully been completed."
},
"customDpaHandler": {
"type": "boolean",
"description": "If set, then a Custom DPA handler is called in case of an event."
},
"dpaPeerToPeer": {
"type": "boolean",
"description": "If set, then DP2P is enabled at [N]."
},
"nodeDpaInterface": {
"type": "boolean",
"description": "If set, then Node device can be controlled by a SPI or UART interface. Valid only in DPA version < 4.00"
},
"uartBaudrate": {
"type": "integer",
"description": "Baud rate of the UART interface if one is used."
},
"localFRCreception": {
"type": "boolean",
"description": "If set, then Local FRC reception is enabled at [N]."
},
"dpaAutoexec": {
"type": "boolean",
"description": "If set, then DPA Autoexec is run at a later stage of the module boot time."
},
"routingOff": {
"type": "boolean",
"description": "If set, then the Node device does not route packets on the background."
},
"ioSetup": {
"type": "boolean",
"description": "If set, then DPA IO Setup is run at an early stage of the module boot time."
},
"peerToPeer": {
"type": "boolean",
"description": "If set, then device receives also peer-to-peer (non-networking) packets and raises PeerToPeer event."
},
"neverSleep": {
"type": "boolean",
"description": "If set, then unbonded Node using default IQRF buttons never sleeps during the button bonding. From DPA v3.03"
},
"stdAndLpNetwork": {
"type": "boolean",
"description": "If the bit is set, then the [C] controls the STD+LP network; otherwise, it controls the STD network. The bit can only be changed if the network is empty (no [Ns] are bonded) otherwise the network will stop working. From DPA v4.00"
}
},
"required": [
"deviceAddr"
]
},
"raw": {
"type": "array",
"description": "Returns array of objects req-cnf-rsp, see its description.",
"items": {
"type": "object",
"properties": {
"request": {
"type": "string",
"description": "Binary buffer with DPA request."
},
"requestTs": {
"type": "string",
"description": "YYYY-MM-DDTHH:MM:SS.SSS±HH:MM"
},
"confirmation": {
"type": "string",
"description": "Binary buffer with DPA confirmation."
},
"confirmationTs": {
"type": "string",
"description": "YYYY-MM-DDTHH:MM:SS.SSS±HH:MM"
},
"response": {
"type": "string",
"description": "Binary buffer with DPA response."
},
"responseTs": {
"type": "string",
"description": "YYYY-MM-DDTHH:MM:SS.SSS±HH:MM"
}
},
"required": [
"request",
"requestTs",
"confirmation",
"confirmationTs",
"response",
"responseTs"
]
}
},
"insId": {
"type": "string",
"description": "IQRF GW daemon instance identification."
},
"status": {
"type": "integer",
"description": "IQRF GW daemon API (general or mType) status."
},
"statusStr": {
"type": "string",
"description": "IQRF GW daemon API (general or mType) status in string form."
}
},
"required": [
"msgId",
"status"
]
}
},
"required": [
"mType",
"data"
]
}
......@@ -141,6 +141,10 @@
"type": "integer",
"description": "A nonzero value specifies an alternative DPA service mode channel."
},
"localFRCreception": {
"type": "boolean",
"description": "If set, then Local FRC reception is enabled at [N]."
},
"rfPgmEnableAfterReset": {
"type": "boolean",
"description": "If sets, then activates RFPGM invoking by TR module reset."
......
......@@ -332,7 +332,7 @@ namespace iqrf {
std::unique_ptr<IIqrfDpaService::ExclusiveAccess> m_exclusiveAccess;
// number of repeats
uint8_t m_repeat;
int m_repeat;
// if is set Verbose mode
bool m_returnVerbose = false;
bool m_morePeripheralsInfo = false;
......@@ -420,7 +420,7 @@ namespace iqrf {
{
// get discovered indicator
try {
uint8_t byteIndex = deviceEnumerateResult.getDeviceAddr() / 8;
uint8_t byteIndex = (uint8_t)(deviceEnumerateResult.getDeviceAddr() / 8);
uint8_t nodeDiscoveryByte = nodeDiscovered(deviceEnumerateResult, byteIndex);
......@@ -486,7 +486,7 @@ namespace iqrf {
m_exclusiveAccess->executeDpaTransactionRepeat( osReadPtr->getRequest(), transResult, m_repeat );
osReadPtr->processDpaTransactionResult( std::move(transResult) );
TRC_DEBUG("Result from OS read transaction as string:" << PAR( osReadPtr->getResult()->getErrorString()) );
deviceEnumerateResult.setOsBuild( osReadPtr->getOsBuild() );
deviceEnumerateResult.setOsBuild( (uint16_t)osReadPtr->getOsBuild() );
deviceEnumerateResult.setEnumeratedNodeHwpId( osReadPtr->getHwpid() );
deviceEnumerateResult.addTransactionResult( osReadPtr->getResultMove() );
deviceEnumerateResult.setOsRead( osReadPtr );
......@@ -514,7 +514,7 @@ namespace iqrf {
m_exclusiveAccess->executeDpaTransactionRepeat( exploreEnumeratePtr->getRequest(), transResultPerEnum, m_repeat );
exploreEnumeratePtr->processDpaTransactionResult( std::move(transResultPerEnum) );
TRC_DEBUG( "Result from peripheral enumeration transaction as string:" << PAR( exploreEnumeratePtr->getResult()->getErrorString() ) );
deviceEnumerateResult.setEnumeratedNodeHwpIdVer( exploreEnumeratePtr->getHwpidVer() );
deviceEnumerateResult.setEnumeratedNodeHwpIdVer( (uint16_t)exploreEnumeratePtr->getHwpidVer() );
deviceEnumerateResult.addTransactionResult( exploreEnumeratePtr->getResultMove() );
deviceEnumerateResult.setPerEnum( exploreEnumeratePtr );
......@@ -612,10 +612,10 @@ namespace iqrf {
);
// Parse response pdata
uns8* bondedNodesArr = dpaResponse.DpaPacket().DpaResponsePacket_t.DpaMessage.Response.PData;
uint8_t byteIndex = deviceAddr / 8;
uint8_t byteIndex = (uint8_t)(