misc_BT.h
上传用户:gelin96
上传日期:2017-01-08
资源大小:20993k
文件大小:3k
- #ifndef _MISC_BT_H_
- #define _MISC_BT_H_
- /*---------------------------------------------------------------------------*/
- #include <vcl.h>
- #ifndef META_DLL_H
- #include "meta.h"
- #endif
- #ifndef _BT_HCI_H_
- #include "bt_hci.h"
- #endif
- /*---------------------------------------------------------------------------*/
- // format transform
- extern bool BTHCIValue_To_AnsiString( S_BT_HCI_VALUE hci_value, AnsiString &ansi_str );
- extern bool BTHCIValue_To_Hex_AnsiString( S_BT_HCI_VALUE hci_value, AnsiString &ansi_str );
- extern bool BDAddress_To_Hex_AnsiString( S_BD_ADDR bd_addr, AnsiString &ansi_str );
- extern bool BDAddress_To_Hex_Colon_AnsiString( S_BD_ADDR bd_addr, AnsiString &ansi_str );
- extern bool AnsiString_To_Hex_BDAddress( AnsiString ansi_str, S_BD_ADDR &bd_addr );
- extern bool Colon_AnsiString_To_Hex_BDAddress( AnsiString ansi_str, S_BD_ADDR &bd_addr );
- extern bool AnsiString_To_BTHCIValue( AnsiString ansi_str, S_BT_HCI_VALUE &out_value );
- extern bool AnsiString_Hex_To_BTHCIValue( AnsiString ansi_str, S_BT_HCI_VALUE &out_value );
- extern bool AnsiString_Hex_To_BTPIN( AnsiString ansi_str, S_BT_PIN &pt_pin );
- // range check
- extern bool IsValidHexBTHCIValue( AnsiString ansi_str, unsigned char bytes, S_BT_HCI_VALUE &hci_value, S_BT_HCI_VALUE &min_hci_value, S_BT_HCI_VALUE &max_hci_value );
- extern bool IsValidHexBDAddress( AnsiString ansi_str, S_BD_ADDR &bd_addr );
- extern bool IsValidHexBTPIN( AnsiString ansi_str, S_BT_PIN &pin );
- extern bool IsValidDecBTHCIValue( AnsiString ansi_str, unsigned char bytes, S_BT_HCI_VALUE &hci_value, S_BT_HCI_VALUE &min_hci_value, S_BT_HCI_VALUE &max_hci_value );
- extern bool IsValidHexBTHCIOpcode( AnsiString ansi_str, unsigned short &opcode );
- extern bool IsValidHexBTHCIEventIndex( AnsiString ansi_str, unsigned char &event_idx );
- extern bool IsValidBTFreq( AnsiString ansi_str, unsigned char &freq );
- extern bool IsValidBTTxDataLength( AnsiString ansi_str, unsigned short &len, unsigned short range_min, unsigned short range_max );
- extern bool IsValidBTTxPollPeriod( AnsiString ansi_str, unsigned char &period );
- extern bool IsValidBTTxPacketCount( AnsiString ansi_str, unsigned int &count );
- extern bool IsValidBTTxPcl( AnsiString ansi_str, unsigned char &pcl );
- extern bool IsValidHexBTLAP( AnsiString ansi_str, unsigned int &lap );
- extern bool IsValidHexBTTxAccessCode( AnsiString ansi_str, unsigned char &code );
- extern bool IsValidHexBDAddress( AnsiString ansi_str, unsigned char &address );
- extern bool IsValidDecBTHCIValue( AnsiString ansi_str, unsigned char bytes, S_BT_HCI_VALUE &value );
- extern bool IsValidHexBTHCIValue( AnsiString ansi_str, unsigned char bytes, S_BT_HCI_VALUE &value );
- extern bool IsValidBTTimeout( AnsiString ansi_str, unsigned int &timeout );
- // ESCO
- extern bool IsValidTxBandwidth( AnsiString ansi_str, unsigned int &ui_bandwidth );
- extern bool IsValidRxBandwidth( AnsiString ansi_str, unsigned int &ui_bandwidth );
- extern bool IsValidMaxLatency( AnsiString ansi_str, unsigned short &us_latency );
- extern bool IsValidRetransmissionEffort( AnsiString ansi_str, unsigned char &uc_effort );
- #endif