tailieunhanh - McGraw-Hill PDA Robotics 2003 (By.Laxxuss) Part 11

Tham khảo tài liệu 'mcgraw-hill pda robotics 2003 () part 11', kỹ thuật - công nghệ, cơ khí - chế tạo máy phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | PDA Robotics Disable the wireless button since we MUST first be connetd to the command center before initializing the IrDA connection if we want to use the wireless link FALSE Below is the code listing for InitiateIrDAConnection . bool CPDABotDlg InitiateIrDAConnection Initiate an IrDA client define DEVICE_LIST_LEN 5 define IAS_QUERY_ATTRIB_MAX_LEN 32 DevListBuff discovery buffer stores the information that PDARobots body will send to us in the initial stages of the IrDA handshake BYTE DevListBuff sizeof DEVICELIST - sizeof IRDA_DEVICE_INFO sizeof IRDA_DEVICE_INFO DEVICE_LIST_LEN int DevListLen sizeof DevListBuff This list stores all the devices that responded to our IrDA query. There may be an IrDA compliant printer like my HP1000 and the PDABot body. We should look for Generic IrDA and connect with only this device. I will leave this modification up to you. See the chapter on the PalmOS software for instructions on how to do this. For now I pick the first device in the list. PDEVICELIST pDevList PDEVICELIST DevListBuff buffer for IAS query BYTE IASQueryBuff sizeof IAS_QUERY - 3 IAS_QUERY_ATTRIB_MAX_LEN int IASQueryLen sizeof IASQueryBuff PIAS_QUERY pIASQuery PIAS_QuERY IASQueryBuff for searching through peers IAS response 178 Chapter 9 PDA Robot Software for Pocket PC 2002 BOOL Found FALSE UCHAR pPI pPL pPV for the setsockopt call to enbale 9 wire IrCOMM int Enable9WireMode 1 CString msg SOCKADDR_IRDA DstAddrIR AF_IRDA 0 0 0 0 IrDA IrCOMM Create the Infrared Socket if Infrared_Socket socket AF_IRDA SOCK_STREAM NULL INVALID_SOCKE Get the error and display it in the status edit box int last_error WSAGetLastError if last_error WSAESOCKTNOSUPPORT MessageId WSAESOCKTNOSUPPORT MessageText The support for the specified socket type does not exist in this address family. char err_buff 10 _itoa last_error err_buff 0 10 msg Error msg err_buff msg no support for type in this address family AfxMessageBox msg else msg Couldn t get socket this- .

TỪ KHÓA LIÊN QUAN