void openserial_handleEcho(uint8_t* buf, uint8_t bufLen){ // echo back what you received openserial_printData( buf, bufLen ); }
void openserial_echo(uint8_t* buf, uint8_t bufLen){ INTERRUPT_DECLARATION(); // echo back what you received openserial_printData( buf, bufLen ); DISABLE_INTERRUPTS(); openserial_vars.inputBufFill = 0; ENABLE_INTERRUPTS(); }
/** \brief Receive a frame at the openbridge, which sends it out over serial. */ void openbridge_receive(OpenQueueEntry_t* msg) { // prepend previous hop packetfunctions_reserveHeaderSize(msg,LENGTH_ADDR64b); memcpy(msg->payload,msg->l2_nextORpreviousHop.addr_64b,LENGTH_ADDR64b); // prepend next hop (me) packetfunctions_reserveHeaderSize(msg,LENGTH_ADDR64b); memcpy(msg->payload,idmanager_getMyID(ADDR_64B)->addr_64b,LENGTH_ADDR64b); // send packet over serial (will be memcopied into serial buffer) openserial_printData((uint8_t*)(msg->payload),msg->length); // free packet openqueue_freePacketBuffer(msg); }
void ohlone_receive(OpenQueueEntry_t* msg) { uint8_t payload_index; for (payload_index=0;payload_index<msg->length-3;payload_index++) { if (ohlone_check4chars(msg->payload+payload_index,(unsigned char *) "GET ")) memcpy(ohlone_vars.getRequest, msg->payload + payload_index + 4, msg->length - payload_index - 4); if (ohlone_check4chars(msg->payload+payload_index, (unsigned char *)"\r\n\r\n")) { ohlone_vars.httpChunk = 0; ohlone_sendpkt(); return; } } openserial_printData((uint8_t*)(msg->payload),msg->length); openqueue_freePacketBuffer(msg); }
void tcpprint_receive(OpenQueueEntry_t* msg) { openserial_printData((uint8_t*)(msg->payload),msg->length); //close TCP session, but keep listening opentcp_close(); openqueue_freePacketBuffer(msg); }
void openbridge_receive(OpenQueueEntry_t* msg) { openserial_printData((uint8_t*)(msg->payload),msg->length); openqueue_freePacketBuffer(msg); }