Skip to content

Commit

Permalink
correct reaction on SET, GET and SETGET message types
Browse files Browse the repository at this point in the history
  • Loading branch information
breaker27 committed Jan 6, 2014
1 parent 04f6c57 commit c6cd415
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions firmware/shc_powerswitch/shc_powerswitch.c
Expand Up @@ -217,8 +217,15 @@ void process_message(MessageTypeEnum messagetype, uint32_t messagegroupid, uint3

inc_packetcounter();

// "Set" -> send "Ack"
if (messagetype == MESSAGETYPE_SET)
{
pkg_header_init_powerswitch_switchstate_ack();

UART_PUTS("Sending Ack\r\n");
}
// "Get" or "SetGet" -> send "AckStatus"
if ((messagetype == MESSAGETYPE_GET) && (messagetype != MESSAGETYPE_SETGET))
else
{
pkg_header_init_powerswitch_switchstate_ackstatus();

Expand All @@ -228,13 +235,6 @@ void process_message(MessageTypeEnum messagetype, uint32_t messagegroupid, uint3

UART_PUTS("Sending AckStatus\r\n");
}
// "Set" -> send "Ack"
else
{
pkg_header_init_powerswitch_switchstate_ack();

UART_PUTS("Sending Ack\r\n");
}

// set common fields
pkg_header_set_senderid(device_id);
Expand Down

0 comments on commit c6cd415

Please sign in to comment.