39 int which = whichdongle;
52 pszPath=strdup(phdi->
path);
91 unsigned char aucBufIn[65];
92 unsigned char aucBufOut[65];
107 memset(aucBufIn, 0xCC, 65);
118 if (strncmp((
char *)(aucBufIn+2),
"FCDBL", 5) == 0) {
122 else if (strncmp((
char *)(aucBufIn+2),
"FCDAPP", 6) == 0) {
143 unsigned char aucBufIn[65];
144 unsigned char aucBufOut[65];
159 memset(aucBufIn, 0xCC, 65);
170 if (strncmp((
char *)(aucBufIn+2),
"FCDBL", 5) == 0) {
174 else if (strncmp((
char *)(aucBufIn+2),
"FCDAPP", 6) == 0) {
175 strncpy(str, (
char *)(aucBufIn+9), 5);
208 unsigned char aucBufIn[65];
209 unsigned char aucBufOut[65];
228 memset(aucBufIn, 0xCC, 65);
239 if (strncmp((
char *)(aucBufIn+2),
"FCDBL", 5) == 0) {
243 else if (strncmp((
char *)(aucBufIn+2),
"FCDAPP", 6) == 0) {
246 fcd_caps->
hasBiasT = (aucBufIn[21] ==
'1') ? 1 : 0;
249 if (strncmp((
char *)(aucBufIn+23),
"No blk", 6) == 0) {
284 unsigned char aucBufIn[65];
285 unsigned char aucBufOut[65];
300 memset(aucBufIn, 0xCC, 65);
311 if (strncmp((
char *)(aucBufIn+2),
"FCDBL", 5) == 0) {
315 else if (strncmp((
char *)(aucBufIn+2),
"FCDAPP", 6) == 0) {
317 strncpy(caps_str, (
char *)(aucBufIn+2), 27);
343 unsigned char aucBufOut[65];
403 unsigned char aucBufIn[65];
404 unsigned char aucBufOut[65];
417 aucBufOut[2] = (
unsigned char)nFreq;
418 aucBufOut[3] = (
unsigned char)(nFreq>>8);
419 aucBufOut[4] = (
unsigned char)(nFreq>>16);
421 memset(aucBufIn, 0xCC, 65);
453 unsigned char aucBufIn[65];
454 unsigned char aucBufOut[65];
467 aucBufOut[2] = (
unsigned char)nFreq;
468 aucBufOut[3] = (
unsigned char)(nFreq>>8);
469 aucBufOut[4] = (
unsigned char)(nFreq>>16);
470 aucBufOut[5] = (
unsigned char)(nFreq>>24);
472 memset(aucBufIn, 0xCC, 65);
503 unsigned char aucBufOut[65];
562 unsigned char aucBufIn[65];
563 unsigned char aucBufOut[65];
577 memset(aucBufIn, 0xCC, 65);
609 unsigned char aucBufIn[65];
610 unsigned char aucBufOut[65];
627 memset(aucBufIn, 0xCC, 65);
653 aucBufOut[2] = ((
unsigned char)u32AddrStart);
654 aucBufOut[3] = ((
unsigned char)(u32AddrStart>>8));
655 aucBufOut[4] = ((
unsigned char)(u32AddrStart>>16));
656 aucBufOut[5] = ((
unsigned char)(u32AddrStart>>24));
658 memset(aucBufIn, 0xCC, 65);
673 for (u32Addr=u32AddrStart; u32Addr+47<u32AddrEnd && u32Addr+47<n64Size; u32Addr+=48)
675 memcpy(&aucBufOut[3], &pc[u32Addr], 48);
678 memset(aucBufIn, 0xCC, 65);
711 unsigned char aucBufIn[65];
712 unsigned char aucBufOut[65];
729 memset(aucBufIn, 0xCC, 65);
756 aucBufOut[2] = ((
unsigned char)u32AddrStart);
757 aucBufOut[3] = ((
unsigned char)(u32AddrStart>>8));
758 aucBufOut[4] = ((
unsigned char)(u32AddrStart>>16));
759 aucBufOut[5] = ((
unsigned char)(u32AddrStart>>24));
761 memset(aucBufIn, 0xCC, 65);
776 for (u32Addr=u32AddrStart; u32Addr+47<u32AddrEnd && u32Addr+47<n64Size; u32Addr+=48)
779 memset(aucBufIn, 0xCC, 65);
791 if (memcmp(&aucBufIn[2],&pc[u32Addr],48)!=0)
829 unsigned char aucBufOut[65];
830 unsigned char aucBufIn[65];
842 memcpy(aucBufOut+2, pu8Data,u8len);
846 memset(aucBufIn,0xCC,65);
850 if (aucBufIn[0]==u8Cmd && aucBufIn[1]==1) {
887 unsigned char aucBufOut[65];
888 unsigned char aucBufIn[65];
901 memset(aucBufIn,0xCC,65);
904 memcpy(pu8Data,aucBufIn+2,u8len);
907 if (aucBufIn[0]==u8Cmd && aucBufIn[1]==1) {
FCD_MODE_ENUM fcdBlVerifyFirmware(hid_device *phd, char *pc, int64_t n64Size)
Verify firmware in FCd flash.
FCD_MODE_ENUM fcdAppSetParam(hid_device *phd, uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len)
Write FCD parameter (e.g. gain or filter)
void fcdClose(hid_device *phd)
Close FCD HID device.
#define FCD_CMD_APP_SET_FREQ_HZ
FCD_MODE_ENUM fcdAppSetFreq(hid_device *phd, int nFreq)
Set FCD frequency with Hz resolution.
#define FCD_CMD_BL_GET_BYTE_ADDR_RANGE
#define FCD_CMD_BL_SET_BYTE_ADDR
FCD_MODE_ENUM fcdGetCapsStr(hid_device *phd, char *caps_str)
Get hardware and firmware dependent FCD capabilities as string.
FCD_MODE_ENUM fcdGetMode(hid_device *phd)
Get FCD mode.
#define FCD_CMD_APP_RESET
Reset to bootloader.
#define FCD_CMD_APP_SET_FREQ_KHZ
FCD_MODE_ENUM
FCD mode enumeration.
#define FCD_CMD_BL_WRITE_FLASH_BLOCK
void HID_API_EXPORT hid_close(hid_device *dev)
Close a HID device.
int HID_API_EXPORT hid_read(hid_device *dev, unsigned char *data, size_t length)
Read an Input report from a HID device.
FCD_MODE_ENUM fcdGetCaps(hid_device *phd, FCD_CAPS_STRUCT *fcd_caps)
Get hardware and firmware dependent FCD capabilities.
struct hid_device_info * next
hid_device * fcdOpen(uint16_t usVID, uint16_t usPID, int whichdongle)
Open FCD device.
hid_device *HID_API_EXPORT hid_open_path(const char *path)
Open a HID device by its path name.
FCD_MODE_ENUM fcdGetFwVerStr(hid_device *phd, char *str)
Get FCD firmware version as string.
FCD_MODE_ENUM fcdAppReset(hid_device *phd)
Reset FCD to bootloader mode.
struct hid_device_info HID_API_EXPORT * hid_enumerate(unsigned short vendor_id, unsigned short product_id)
Enumerate the HID Devices.
FCD_MODE_ENUM fcdAppGetParam(hid_device *phd, uint8_t u8Cmd, uint8_t *pu8Data, uint8_t u8len)
Read FCD parameter (e.g. gain or filter)
FCD_MODE_ENUM fcdBlWriteFirmware(hid_device *phd, char *pc, int64_t n64Size)
Write new firmware into the FCD.
#define FCD_CMD_BL_READ_FLASH_BLOCK
FCD_MODE_ENUM fcdBlErase(hid_device *phd)
Erase firmware from FCD.
FCD_MODE_ENUM fcdBlReset(hid_device *phd)
Reset FCD to application mode.
void HID_API_EXPORT hid_free_enumeration(struct hid_device_info *devs)
Free an enumeration Linked List.
FCD capabilities that depend on both hardware and firmware.
unsigned char hasCellBlock
int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t length)
Write an Output report to a HID device.
FCD_MODE_ENUM fcdAppSetFreqkHz(hid_device *phd, int nFreq)
Set FCD frequency with kHz resolution.