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;
125 vector<string> GetPorts();
145 size_t GetDeviceCount();
165 bool SetLoggerEnabled(
170 float maxDiskSpacePercent = 0.5f,
171 uint32_t maxFileSize = 1024 * 1024 * 5,
178 void BroadcastBinaryDataRmcPreset(uint64_t rmcPreset=
RMC_PRESET_INS_BITS, uint32_t rmcOptions=0);
191 bool OpenServerConnection(
const string& connectionString);
198 bool CreateHost(
const string& ipAndPort);
203 void CloseServerConnection();
208 void StopBroadcasts(
bool allPorts=
true);
226 void SendRawData(
eDataIDs dataId, uint8_t* data, uint32_t length = 0, uint32_t offset = 0);
235 if ((
size_t)pHandle >= m_comManagerState.devices.size())
239 return m_comManagerState.devices[pHandle].
devInfo;
249 if ((
size_t)pHandle >= m_comManagerState.devices.size())
253 return m_comManagerState.devices[pHandle].sysCmd;
270 if ((
size_t)pHandle >= m_comManagerState.devices.size())
274 return m_comManagerState.devices[pHandle].flashConfig;
282 void SetFlashConfig(
const nvm_flash_cfg_t& flashConfig,
int pHandle = 0);
297 if ((
size_t)pHandle >= m_comManagerState.devices.size())
301 return &(m_comManagerState.devices[pHandle].serialPort);
330 bool OnPacketReceived(
const uint8_t* data, uint32_t dataLength);
344 char m_clientBuffer[512];
357 bool EnableLogging(
const string& path,
cISLogger::eLogType logType,
float maxDiskSpacePercent, uint32_t maxFileSize,
const string& subFolder);
358 void DisableLogging();
359 bool HasReceivedResponseFromDevice(
size_t index);
360 bool HasReceivedResponseFromAllDevices();
361 void RemoveDevice(
size_t index);
362 bool OpenSerialPorts(
const char* port,
int baudRate);
363 static void LoggerThread(
void* info);
#define IS_COM_BAUDRATE_DEFAULT
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)
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