Add ARM support for functions and types required for UUID/PSM lookup.

Almost works: if the ARM build is running as host, all's well; but if
it's client, gets btLibL2DiscConnPsmUnsupported after trying to make
an l2c connection.
This commit is contained in:
ehouse 2007-09-30 17:33:19 +00:00
parent 556dbf46e3
commit 3480df738c
4 changed files with 50 additions and 6 deletions

View file

@ -246,4 +246,11 @@ BtLibSocketListen
#BtLibRegisterManagementNotification
#BtLibUnregisterManagementNotification
#BtLibSocketCreate
BtLibGetRemoteDeviceName
BtLibSdpServiceRecordCreate
BtLibSdpServiceRecordStopAdvertising
BtLibSdpGetPsmByUuid
BtLibSdpServiceRecordSetAttributesForSocket
BtLibSdpServiceRecordStartAdvertising
BtLibSdpServiceRecordDestroy
#endif

View file

@ -1,5 +1,5 @@
#!/usr/bin/perl
# Copyright 2004 by Eric House (xwords@eehouse.org). All rights reserved.
# Copyright 2004-2007 by Eric House (xwords@eehouse.org). All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -209,6 +209,15 @@ my %typeInfo = (
"autoSwap" => -1 },
"BtLibSocketListenInfoType*" => { "size" => 4, "a0" => 1,
"autoSwap" => -1 },
"BtLibSdpRecordHandle" => { "size" => 4, "a0" => 1 },
"BtLibSdpRecordHandle*"=> { "size" => 4, "a0" => 1,
"autoSwap" => 4 },
"BtLibSdpUuidType*" => { "size" => 4, "a0" => 1,
"autoSwap" => -1 },
"BtLibFriendlyNameType*" => { "size" => 4, "a0" => 1,
"autoSwap" => -1 },
"BtLibGetNameEnum" => { "size" => 1, "a0" => 0 }, # enum
);
sub name_compact($) {

View file

@ -139,8 +139,8 @@ read_unaligned32( const unsigned char* src )
#include "pnostate.h"
Err
HsNavDrawFocusRing (FormType* formP, UInt16 objectID, Int16 extraInfo,
RectangleType* rP,
HsNavFocusRingStyleEnum ringStyle, Boolean forceRestore)
RectangleType* rP,
HsNavFocusRingStyleEnum ringStyle, Boolean forceRestore)
{
Err result;
FUNC_HEADER(HsNavDrawFocusRing);
@ -1389,4 +1389,19 @@ flipBtSocketListenInfoArm268K( unsigned char* out,
write_unaligned16( out + 4, in->data.L2Cap.minRemoteMtu );
}
void
flipBtLibSdpUuidTypeArm268K( unsigned char* out, const BtLibSdpUuidType* in )
{
write_unaligned8( out + 0, in->size ); /* size 1 on 68K, 4 on ARM */
memcpy( out + 1, &in->UUID, sizeof(in->UUID) ); /* offset 68K: 1; ARM: 4 */
}
void
flipBtLibFriendlyNameTypeArm268K( unsigned char* out,
const BtLibFriendlyNameType* in )
{
write_unaligned32( out + 0, in->name );
write_unaligned8( out + 4, in->nameLength );
}
#endif /* XWFEATURE_BLUETOOTH */

View file

@ -1,6 +1,6 @@
/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */
/*
* Copyright 2004 by Eric House (xwords@eehouse.org). All rights reserved.
* Copyright 2004-2007 by Eric House (xwords@eehouse.org). All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -117,10 +117,23 @@ void flipBtSocketListenInfoArm268K( unsigned char* out,
# define SWAP_BTLIBSOCKETCONNECTINFOTYPE_ARM_TO_68K( out, in ) \
flipBtConnInfoArm268K( out, in )
# define SWAP_BTLIBSOCKETCONNECTINFOTYPE_68K_TO_ARM( out, in ) /* nothing for now */
# define SWAP_BTLIBSOCKETCONNECTINFOTYPE_68K_TO_ARM( out, in ) /* nop */
# define SWAP_BTLIBSOCKETLISTENINFOTYPE_ARM_TO_68K( out, in ) \
flipBtSocketListenInfoArm268K( out, in )
# define SWAP_BTLIBSOCKETLISTENINFOTYPE_68K_TO_ARM( out, in ) /* nothing for now */
# define SWAP_BTLIBSOCKETLISTENINFOTYPE_68K_TO_ARM( out, in ) /* nop */
void flipBtLibSdpUuidTypeArm268K( unsigned char* out,
const BtLibSdpUuidType* in );
void flipBtLibFriendlyNameTypeArm268K( unsigned char* out,
const BtLibFriendlyNameType* in );
# define SWAP_BTLIBSDPUUIDTYPE_ARM_TO_68K( out, in ) \
flipBtLibSdpUuidTypeArm268K( out, in )
# define SWAP_BTLIBSDPUUIDTYPE_68K_TO_ARM( out, in ) /* nothing */
# define SWAP_BTLIBFRIENDLYNAMETYPE_ARM_TO_68K( out, in ) \
flipBtLibFriendlyNameTypeArm268K( out, in )
# define SWAP_BTLIBFRIENDLYNAMETYPE_68K_TO_ARM( out, in ) /* nothing? */
#endif /* XWFEATURE_BLUETOOTH */
PNOState* getStorageLoc(void);