13 #ifndef __INTERTIALSENSE_H 14 #define __INTERTIALSENSE_H 36 #if PLATFORM_IS_WINDOWS 38 #pragma comment (lib, "Ws2_32.lib") 56 typedef std::function<void(InertialSense* i, p_data_t* data, int pHandle)>
pfnHandleBinaryData;
126 vector<string> GetPorts();
146 size_t GetDeviceCount();
166 bool SetLoggerEnabled(
171 float maxDiskSpacePercent = 0.5
f,
172 uint32_t maxFileSize = 1024 * 1024 * 5,
179 void BroadcastBinaryDataRmcPreset(uint64_t rmcPreset=
RMC_PRESET_INS_BITS, uint32_t rmcOptions=0);
192 bool OpenServerConnection(
const string& connectionString);
199 bool CreateHost(
const string& ipAndPort);
204 void CloseServerConnection();
209 void StopBroadcasts(
bool allPorts=
true);
227 void SendRawData(
eDataIDs dataId, uint8_t* data, uint32_t length = 0, uint32_t offset = 0);
236 if ((
size_t)pHandle >= m_comManagerState.devices.size())
240 return m_comManagerState.devices[pHandle].
devInfo;
250 if ((
size_t)pHandle >= m_comManagerState.devices.size())
254 return m_comManagerState.devices[pHandle].sysCmd;
271 if ((
size_t)pHandle >= m_comManagerState.devices.size())
275 return m_comManagerState.devices[pHandle].flashConfig;
285 if ((
size_t)pHandle >= m_comManagerState.devices.size())
289 return m_comManagerState.devices[pHandle].evbFlashCfg;
297 void SetFlashConfig(
const nvm_flash_cfg_t& flashConfig,
int pHandle = 0);
304 void SetEvbFlashConfig(
const evb_flash_cfg_t& evbFlashCfg,
int pHandle = 0);
319 if ((
size_t)pHandle >= m_comManagerState.devices.size())
323 return &(m_comManagerState.devices[pHandle].serialPort);
352 bool OnPacketReceived(
const uint8_t* data, uint32_t dataLength);
366 char m_clientBuffer[512];
379 bool EnableLogging(
const string& path,
cISLogger::eLogType logType,
float maxDiskSpacePercent, uint32_t maxFileSize,
const string& subFolder);
380 void DisableLogging();
381 bool HasReceivedResponseFromDevice(
size_t index);
382 bool HasReceivedResponseFromAllDevices();
383 void RemoveDevice(
size_t index);
384 bool OpenSerialPorts(
const char* port,
int baudRate);
385 static void LoggerThread(
void* info);
#define IS_COM_BAUDRATE_DEFAULT
evb_flash_cfg_t GetEvbFlashConfig(int pHandle=0)
is_comm_instance_t m_gpComm
NMI_API SOCKET socket(uint16 u16Domain, uint8 u8Type, uint8 u8Flags)
std::function< void(InertialSense *i, p_data_t *data, int pHandle)> pfnHandleBinaryData
uint64_t m_clientServerByteCount
const dev_info_t GetDeviceInfo(int pHandle=0)
uint64_t GetClientServerByteCount()
pfnHandleBinaryData binaryCallbackGlobal
nvm_flash_cfg_t flashConfig
void SetTimeoutFlushLoggerSeconds(time_t timeoutFlushLoggerSeconds)
int m_clientBufferBytesToSend
#define RMC_PRESET_INS_BITS
system_command_t GetSysCmd(int pHandle=0)
nvm_flash_cfg_t GetFlashConfig(int pHandle=0)
com_manager_port_t * m_cmPorts
int(* pfnBootloadProgress)(const void *obj, float percent)
bool m_disableBroadcastsOnClose
USBInterfaceDescriptor data
cISStream * m_clientStream
InertialSense::com_manager_cpp_state_t m_comManagerState
serial_port_t * GetSerialPort(int pHandle=0)
InertialSense * inertialSenseInterface
vector< is_device_t > devices
static const string g_emptyString
#define IS_BAUD_RATE_BOOTLOADER
void(* pfnBootloadStatus)(const void *obj, const char *infoString)
evb_flash_cfg_t evbFlashCfg
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
#define RMC_PRESET_PPD_BITS
com_manager_init_t m_cmInit
map< int, vector< p_data_t > > m_logPackets
time_t GetTimeoutFlushLoggerSeconds()
cISSerialPort m_serialServer
void(* pfnStepLogFunction)(InertialSense *i, const p_data_t *data, int pHandle)
pfnStepLogFunction stepLogFunction