You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
629 B
32 lines
629 B
/*
|
|
* dispatch.cpp
|
|
*
|
|
* Created on: 18 Jul 2021
|
|
* Author: Andreas Berthoud
|
|
*/
|
|
|
|
#include "dispatch.hpp"
|
|
|
|
#include "GPCommand.hpp"
|
|
#include "HeartbeatCommand.hpp"
|
|
#include "LedCommand.hpp"
|
|
|
|
void handle_received_command(uint8_t command_id, uint8_t * payload_ptr, uint16_t size) {
|
|
|
|
switch (command_id)
|
|
{
|
|
case COMMAND_HEARTBEAT_REQUEST:
|
|
push_command(new HeartbeatRequest(payload_ptr, size));
|
|
break;
|
|
case COMMAND_LED_REQUEST:
|
|
push_command(new LedRequest(payload_ptr, size));
|
|
break;
|
|
case COMMAND_GP_REQUEST:
|
|
push_command(new GPRequest(payload_ptr, size));
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
|
|
}
|
|
|