Skip to content
Snippets Groups Projects
Commit a5313470 authored by athatheocsd's avatar athatheocsd
Browse files

TC[19,7] Completed

Standard's services completed
parent eefe5537
No related branches found
No related tags found
No related merge requests found
......@@ -127,6 +127,13 @@ void EventActionService::requestEventActionDefinitionStatus(Message message) {
void EventActionService::eventActionStatusReport() {
// TM[19,7]
Message report = createTM(7);
uint8_t count = 0;
for (uint16_t i = 0; i < 256; i++) {
if (eventActionDefinitionArray[i].empty == 0) {
count++;
}
}
report.appendUint8(count);
for (uint16_t i = 0; i < 256; i++) {
if (eventActionDefinitionArray[i].empty == 0) {
report.appendEnum16(eventActionDefinitionArray[i].applicationId);
......
......@@ -203,6 +203,36 @@ TEST_CASE("Request event-action definition status TC[19,6]", "[service][st09]")
}
TEST_CASE("Event-action status report TM[19,7]", "[service][st09]") {
EventActionService eventActionService;
Message message0(19, 1, Message::TC, 0);
message0.appendEnum16(1);
message0.appendEnum16(0);
String<64> data = "0";
message0.appendString(data);
eventActionService.addEventActionDefinitions(message0);
Message message1(19, 1, Message::TC, 0);
message1.appendEnum16(1);
message1.appendEnum16(2);
data = "2";
message1.appendString(data);
eventActionService.addEventActionDefinitions(message1);
Message message2(19, 5, Message::TC, 0);
message2.appendUint16(1);
message2.appendEnum16(1);
message2.appendEnum16(0);
eventActionService.disableEventActionDefinitions(message2);
eventActionService.eventActionStatusReport();
REQUIRE(ServiceTests::hasOneMessage());
Message report = ServiceTests::get(0);
CHECK(report.readUint8() == 2);
CHECK(report.readEnum16() == 1);
CHECK(report.readEnum16() == 0);
CHECK(report.readUint8() == 0);
CHECK(report.readEnum16() == 1);
CHECK(report.readEnum16() == 2);
CHECK(report.readUint8() == 1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment