51 lines
901 B
C
51 lines
901 B
C
#include "../../shared/incp/service.h"
|
|
#include "../../shared/incp/asn1/out/incp_generated.h"
|
|
#include "../../shared/bus/bus.h"
|
|
|
|
|
|
|
|
//In this example, TTC will be passive and will only reply to datareqs and pings
|
|
|
|
|
|
|
|
int main()
|
|
{
|
|
for (;;);
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
// === SUBSYSTEM SPECIFIC INCP IMPLEMENTATIONS ===
|
|
err_t impl_transmit(endpoint_t destination, void *buf, size_t size)
|
|
{
|
|
bus_send(destination, buf, size);
|
|
}
|
|
|
|
err_t impl_populate_dataret(AnyData *data)
|
|
{
|
|
switch (data->kind)
|
|
{
|
|
case ttcRxTotal_PRESENT:
|
|
data->u.ttcRxTotal.bytes = 69; //LATER: Proper data
|
|
return ERR_SUCCESS;
|
|
|
|
case ttcTxTotal_PRESENT:
|
|
data->u.ttcTxTotal.bytes = 420; //LATER: Proper data
|
|
return ERR_SUCCESS;
|
|
|
|
default:
|
|
return ERR_NOT_MINE;
|
|
}
|
|
}
|
|
|
|
void impl_callback_dataret(endpoint_t source, AnyData *data)
|
|
{
|
|
//LATER: Do whatever
|
|
}
|
|
|
|
void impl_callback_pong(endpoint_t source, PingMsg *pong)
|
|
{
|
|
//LATER: Do whatever
|
|
}
|