static inline void UARTSendStatus(int uart_num, int enabled) { OUTGOING_MESSAGE msg; msg.type = UART_STATUS; msg.args.uart_status.uart_num = uart_num; msg.args.uart_status.enabled = enabled; AppProtocolSendMessage(&msg); }
void CheckInterface(BYTE interface_id[8]) { OUTGOING_MESSAGE msg; msg.type = CHECK_INTERFACE_RESPONSE; msg.args.check_interface_response.supported = (memcmp(interface_id, PROTOCOL_IID_IOIO0003, 8) == 0) || (memcmp(interface_id, PROTOCOL_IID_IOIO0002, 8) == 0) || (memcmp(interface_id, PROTOCOL_IID_IOIO0001, 8) == 0); AppProtocolSendMessage(&msg); }
static void SendDigitalInStatusMessage(int pin, int value) { log_printf("SendDigitalInStatusMessage(%d, %d)", pin, value); SAVE_PIN_FOR_LOG(pin); OUTGOING_MESSAGE msg; msg.type = REPORT_DIGITAL_IN_STATUS; msg.args.report_digital_in_status.pin = pin; msg.args.report_digital_in_status.level = value; AppProtocolSendMessage(&msg); }
static void UARTReportTxStatus(int uart_num) { int report; UART_STATE* uart = &uarts[uart_num]; PRIORITY(TX_PRIORITY) { report = uart->num_tx_since_last_report; uart->num_tx_since_last_report = 0; } OUTGOING_MESSAGE msg; msg.type = UART_REPORT_TX_STATUS; msg.args.uart_report_tx_status.uart_num = uart_num; msg.args.uart_report_tx_status.bytes_to_add = report; AppProtocolSendMessage(&msg); }
void AppProtocolInit(ADB_CHANNEL_HANDLE h) { bytes_transmitted = 0; rx_buffer_cursor = 0; rx_message_remaining = 1; rx_message_state = WAIT_TYPE; ByteQueueClear(&tx_queue); OUTGOING_MESSAGE msg; msg.type = ESTABLISH_CONNECTION; msg.args.establish_connection.magic = IOIO_MAGIC; BootloaderVersions(msg.args.establish_connection.hw_impl_ver, msg.args.establish_connection.bl_impl_ver); memcpy(msg.args.establish_connection.fw_impl_ver, FW_IMPL_VER, 8); AppProtocolSendMessage(&msg); }
void AppProtocolInit(CHANNEL_HANDLE h) { _prog_addressT p; bytes_out = 0; rx_buffer_cursor = 0; rx_message_remaining = 1; rx_message_state = WAIT_TYPE; ByteQueueClear(&tx_queue); max_packet = ConnectionGetMaxPacket(h); OUTGOING_MESSAGE msg; msg.type = ESTABLISH_CONNECTION; msg.args.establish_connection.magic = IOIO_MAGIC; _init_prog_address(p, hardware_version); _memcpy_p2d16(msg.args.establish_connection.hw_impl_ver, p, 8); _init_prog_address(p, bootloader_version); _memcpy_p2d16(msg.args.establish_connection.bl_impl_ver, p, 8); memcpy(msg.args.establish_connection.fw_impl_ver, FW_IMPL_VER, 8); AppProtocolSendMessage(&msg); }
static void Echo() { AppProtocolSendMessage((const OUTGOING_MESSAGE*) &rx_msg); }