Ejemplo n.º 1
0
void oscSendMessage(char *address)
{
	// write OSC packet header, argument length = 0bytes
	oscWriteHeader(address, 0);
	// write OSC address to packet
	oscWriteString(address);
	// apply checksum
	oscWriteChecksum();
	// send buffer
	uartSendTxBuffer();
	// wait for completion, transmitter to be ready
	while(!uartReadyTx);
}
Ejemplo n.º 2
0
void sendIO(u08 uartReceiveId, u08 uartSendId)
{
	u08 data;
	bool dataToSend = false;

	while (uartReceiveByte(uartReceiveId, &data))
	{
		dataToSend = true;
		uartAddToTxBuffer(uartSendId, data);
	}

	if (dataToSend)
		uartSendTxBuffer(uartSendId);
}
Ejemplo n.º 3
0
void oscSendMessageInt(char *address, u32 arg)
{
	// write OSC packet header, argument length = 4bytes
	oscWriteHeader(address, 4);
	// write OSC address to packet
	oscWriteString(address);
	// copy arg to buffer
	bufferAddToEnd(uartGetTxBuffer(), *(((unsigned char*)(&arg))+3) );
	bufferAddToEnd(uartGetTxBuffer(), *(((unsigned char*)(&arg))+2) );
	bufferAddToEnd(uartGetTxBuffer(), *(((unsigned char*)(&arg))+1) );
	bufferAddToEnd(uartGetTxBuffer(), *(((unsigned char*)(&arg))+0) );
	// apply checksum
	oscWriteChecksum();
	// send buffer
	uartSendTxBuffer();
	// wait for completion, transmitter to be ready
	while(!uartReadyTx);
}
Ejemplo n.º 4
0
void oscSendMessageString(char *address, char *arg)
{
	u08 len;

	// calculate length of argument string
	for(len=0; PRG_RDB(arg+len); len++);
	len++;						// count a minumum of one null for termination
	if(len&0x03)				// are pad bytes necessary?
		len += 4-(len&0x03);	// add null pad bytes to reach multiple of four

	// write OSC packet header, argument length = 8bytes
	oscWriteHeader(address, len);
	// write OSC address to packet
	oscWriteString(address);
	// write string buffer
	oscWriteString(arg);
	// apply checksum
	oscWriteChecksum();
	// send buffer
	uartSendTxBuffer();
	// wait for completion, transmitter to be ready
	while(!uartReadyTx);
}