mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
Byte-swap psm field to callback on ARM: now both client and host work. Move SDP-related constants out where linux can use too.
This commit is contained in:
parent
38a7c6a87e
commit
9f1d02c7cd
3 changed files with 24 additions and 6 deletions
|
@ -42,6 +42,13 @@ typedef enum {
|
|||
LAST_____FOO
|
||||
} CommsConnType;
|
||||
|
||||
/* WHAT SHOULD THIS BE? Copied from Whiteboard.... PENDING */
|
||||
#define XW_BT_UUID \
|
||||
{ 0x83, 0xe0, 0x87, 0xae, 0x4e, 0x18, 0x46, 0xbe, \
|
||||
0x83, 0xe0, 0x7b, 0x3d, 0xe6, 0xa1, 0xc3, 0x3b }
|
||||
|
||||
#define XW_BT_NAME "Crosswords"
|
||||
|
||||
/* on Palm BtLibDeviceAddressType is a 48-bit quantity. Linux's typeis the
|
||||
same size. Goal is something all platforms support */
|
||||
typedef struct XP_BtAddr { XP_U8 bits[6]; } XP_BtAddr;
|
||||
|
|
|
@ -1211,7 +1211,19 @@ btLibSocketEventType68K_TO_ARM( BtLibSocketEventType* out, const unsigned char*
|
|||
out->eventData.data.dataLen = read_unaligned16( &in[6] );
|
||||
out->eventData.data.data = read_unaligned32( &in[8] );
|
||||
break;
|
||||
case btLibSocketEventSdpGetPsmByUuid:
|
||||
out->eventData.sdpByUuid.param.psm = read_unaligned16( &in[10] );
|
||||
break;
|
||||
|
||||
/* These use status and socket only (if anything) */
|
||||
case btLibSocketEventConnectRequest:
|
||||
case btLibSocketEventConnectedOutbound:
|
||||
case btLibSocketEventSendComplete:
|
||||
case btLibSocketEventDisconnected:
|
||||
case btLibL2DiscConnPsmUnsupported:
|
||||
break;
|
||||
default: /* shut up, compiler */
|
||||
XP_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,11 +125,10 @@ static void palm_bt_log( const char* btfunc, const char* func, Err err );
|
|||
#define CALL_ERR(e,f,...) e = f(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
/* WHAT SHOULD THIS BE? Copied from Whiteboard.... PENDING */
|
||||
static const BtLibSdpUuidType XWORDS_UUID = {
|
||||
btLibUuidSize128,
|
||||
{ 0x83, 0xe0, 0x87, 0xae, 0x4e, 0x18, 0x46, 0xbe,
|
||||
0x83, 0xe0, 0x7b, 0x3d, 0xe6, 0xa1, 0xc3, 0x3b } };
|
||||
XW_BT_UUID
|
||||
};
|
||||
|
||||
static PalmBTStuff* pbt_checkInit( PalmAppGlobals* globals,
|
||||
XP_Bool* userCancelled );
|
||||
|
@ -494,8 +493,8 @@ setupServiceRecord( PalmBTStuff* btStuff )
|
|||
if ( errNone == err ) {
|
||||
CALL_ERR( err, BtLibSdpServiceRecordSetAttributesForSocket,
|
||||
btStuff->btLibRefNum, btStuff->u.master.listenSocket,
|
||||
(BtLibSdpUuidType*)&XWORDS_UUID, 1, APPNAME,
|
||||
StrLen(APPNAME), btStuff->u.master.sdpRecordH );
|
||||
(BtLibSdpUuidType*)&XWORDS_UUID, 1, XW_BT_NAME,
|
||||
StrLen(XW_BT_NAME), btStuff->u.master.sdpRecordH );
|
||||
|
||||
/* 5. BtLibSdpServiceRecordStartAdvertising: make an SDP memory
|
||||
record representing a local SDP service record visible to
|
||||
|
@ -1020,7 +1019,7 @@ socketCallback( BtLibSocketEventType* sEvent, UInt32 refCon )
|
|||
btStuff->u.slave.remotePsm = sEvent->eventData.sdpByUuid.param.psm;
|
||||
SET_STATE( btStuff, PBTST_SDP_QUERIED );
|
||||
pbt_postpone( btStuff, PBT_ACT_CONNECT_L2C );
|
||||
} else if ( sEvent->status == btLibErrSdpQueryDisconnect ) {
|
||||
} else if ( sEvent->status == btLibErrSdpQueryDisconnect ) {
|
||||
/* Maybe we can just ignore this... */
|
||||
XP_ASSERT( GET_STATE(btStuff) == PBTST_NONE );
|
||||
/* waitACL( btStuff ); */
|
||||
|
|
Loading…
Reference in a new issue