;L2CAP send/receive routines include "settings.inc" include "ti83plus.inc" include "equates.inc" include "usb8x.inc" include "bluetooth.inc" SEGMENT Main GLOBALS ON L2CAP_SendData: ;Sends a block of data using the L2CAP protocol. ;Inputs: ; IX points to connection handle structure ; HL points to data to send ; BC is the number of bytes to send ; D is the RAM page to read from (or 0 if from RAM pages 81h/80h) ;Outputs: ; Data sent to remote device specified by connection handle ; Returns carry flag set if problems scf ret L2CAP_RequestData: ;Requests incoming data using the L2CAP protocol. ;Inputs: ; HL points to buffer to receive data ; D is the RAM page to write to (or 0 if to RAM pages 81h/80h) ;ld (ptrL2CAPBuffer),hl ;ld (ptrL2CAPStart),hl ld a,d ld (RAMPage),a ld a,(dataInPipe) ld b,a U_CALL ReqData xor a ret L2CAP_IsDataAvailable: ;Returns whether a complete L2CAP packet has been received. ;Outputs: ; Returns NZ if complete L2CAP packet has been received to buffer (from L2CAP_RequestData) ld ix,responseFlag ;bit L2CAPDataReceived,(ix+0) ;res L2CAPDataReceived,(ix+0) ret