In FtRoboPy there is a description of a remote I2C implementation.
This works also in C/C++.
The port_I2C can be open and closed. The console log shows that the I2C thread is reacting in the right way.
However there is no official protocol description from fischertechnik available.
Will it be possible that fischertechnik publish the corresponding protocol?
The next info has been extracted from FtRoboPy but it is not covering the complete I2C protocol.
Code: Alles auswählen
port_I2C =65002;
/*******************************************************************************/
/* I2C communication over port 65002,command/respondse ID's */
/******************************************************************************/
ftIF2013CommandId_I2C = 0xB9DB3B39; //write: m_command = 0x02, read: m_command = 0x01
ftIF2013ResponseId_I2C = 0x87FD0D90;
/************************************************************************/
/* I2C communication over port 65002, the data structure */
/************************************************************************/
// Command packet for I2C Command
struct ftIF2013Command_I2C : public ftIF2013Command_Base
{//Todo: what is the structure?
};
// Response packet for I2C Command
struct ftIF2013Response_I2C : public ftIF2013Response_Base
{//Todo: what is the structure?
};
/****************************************************************************/
/* ftIF2013TransferAreaComHandlerEx:: I2C section */
/****************************************************************************/
bool ftIF2013TransferAreaComHandlerEx::StartI2C()
{
// Open camera socket
m_I2Csocket = this->OpenSocket("65002");
if (m_I2Csocket == INVALID_SOCKET)
{
cerr << "StartI2C: Cannot open I2C socket" << endl;
return false;
}
m_I2Cstarted = true;
return true;
};
bool ftIF2013TransferAreaComHandlerEx::StopI2C() {
if (!m_I2Cstarted)
{
cerr << "StopI2C: not started" << endl;
return false;
}
m_I2Cstarted = false;
closesocket(m_I2Csocket);
m_I2Csocket = INVALID_SOCKET;
delete[] m_I2Cbuffer;
m_I2Cbuffersize = 0;
return true;
};