iSuiteTM 3 SDK Protocols -
iTalk
- Introduction
- Message format
- Checksum
- Serial port settings
- iTalk Reference Implementation Software
- Archiving iTalk messages
Introduction
The iTalkTM is the message passing protocol used in the iSuite software for communication between tasks. The protocol is used both to communicate internally between tasks, and externally through I/O ports.The software layers than implement the iTalk protocol transparently convert the data between different representations when transferring messages externally. The purpose of this document is to describe the different representations of the protocol.
This document only describes the generic iTalk protocol, which are identical for all messages. The payload contents of most commonly used messages are described in the iTalk payload format description, and their message identifiers in the iTalk message id description.
Message format
An iTalk message in general has the format shown in the figure
below. The format shown on the left is used when a message is
accessed in memory. The serialized format shown on the right is
used when the message is transferred to an I/O port.
A message consists of a header, which is the same for all message types, and a payload whose format depends on the message type. The fields in the header are the following:
- Maximum number of payload words:
This field is used only in the memory representation. It
depends on the amount of memory allocated for the message,
and specifies the number of words that can be used for the
payload.
- Destination node, destination
task: As the iTalk is a message-passing protocol,
these fields contain the task and node identifier of the task
that will receive the message. The size of the destination
node field is 3 bits and the destination task 5 bits.
- Source node, source task: These specify the task that sent the message. The format is the same as for the destination fields.
- Message identifier: This specifies the message type.
- Transaction id: The iTalk protocol supports transactions, where the sending task will wait for an acknowledgement from the receiving task. The transaction id is used for such messages. If the Response bit (the highest bit, marked with "R" in the figure) is zero and the Transaction id is nonzero, the message is a transaction, and a response will be required. In the response, the same Transaction id is used, and the Response bit is set to 1.
- Payload size: The actual size of
the payload in words. The maximum payload size is 255 words.
- Begin sync character sequence "<!". These mark the
beginning of a message.
- Checksum. This contains a checksum of the payload words.
- End sync character ">". This marks the end of a
message.
The data type representations on different hardware platforms may not be identical. In particular, the floating point representations are different on the iTrax and host platforms. The iTalk protocol software layers automatically convert the data when the messages are converted between the serial and memory representations described above.
Checksum
Checksum is calculated over data payload. Below you can find a sample C-code to calculate the checksum:
/// Compute the checksum for an iTalk
message.
WORD ITK_CalcChecksum(const ITALK_MSG * pMsg)
{
WORD i;
WORD wCheckSum = 0;
// Exclude system header from checksum
WORD* pW = (WORD*)(&(pMsg->wPayload[0]));
for (i = 0; i < pMsg->Hdr.wDataSize; i++)
{
DWORD dwTmp;
dwTmp = ((DWORD)wCheckSum + 1) * ((DWORD)(*pW) + i);
wCheckSum ^= (dwTmp ^ (dwTmp >> 16));
pW ++;
}
return wCheckSum;
}
WORD ITK_CalcChecksum(const ITALK_MSG * pMsg)
{
WORD i;
WORD wCheckSum = 0;
// Exclude system header from checksum
WORD* pW = (WORD*)(&(pMsg->wPayload[0]));
for (i = 0; i < pMsg->Hdr.wDataSize; i++)
{
DWORD dwTmp;
dwTmp = ((DWORD)wCheckSum + 1) * ((DWORD)(*pW) + i);
wCheckSum ^= (dwTmp ^ (dwTmp >> 16));
pW ++;
}
return wCheckSum;
}
Serial port settings
iTrax receivers only supports these serial port settings:
Speed: 115200 (default)
Bytes: 8
Parity: none
Stopbits: 1
Serial speeds of 4800 - 921600 bps are supported.
Bytes: 8
Parity: none
Stopbits: 1
iTalk Reference Implementation Software
Please note, that iTalk 3 Reference implementation Software (iTalkRIS) with full source code is available from Fastrax for all our customers that are using iTrax receivers. To acquire iTalk RIS, please contact us and request for "iTalk RIS" package.
You can send you request through our iSuite Developer Site at http://isuite.fastrax.fi/contact.html
iTalk RIS included full source code for Windows platforms to implement iTalk protocol as well as sample applications. Source code is easily portable to other operating system platforms.
Archiving iTalk messages
iSuite host tools and libraries allow archiving or recording received iTalk messages to mass storage device for later inspection or playback.
See section Archiving for more information.
Go to beginning