SWILIB API (ELKA)    
Loading...
Searching...
No Matches
bluetooth.h
Go to the documentation of this file.
1#pragma once
2
3#ifndef __IN_SWILIB__
4#include "base.h"
5#endif
6
8
17typedef struct SDEV SDEV;
18typedef struct SDEV_APP SDEV_APP;
19typedef struct JSAPI_CONN JSAPI_CONN;
20typedef struct BTLP_CONN BTLP_CONN;
22
26typedef struct CA_REMDEV CA_REMDEV;
27
31struct SDEV {
32 void *fn[15];
33 uint8_t type;
34 int inst;
35 uint8_t app;
36 int index;
37};
38
42struct SDEV_APP {
43 int (*open)(SDEV **ep, int dev_type, const uint8_t *info);
44 void (*reg)(SDEV *dev, const void *info);
45 void *unk;
46 void (*close)(int index);
47 int (*get_dev)(int index, int *inst);
48};
49
53struct JSAPI_CONN {
54 uint16_t handle;
55#ifdef NEWSGOLD
56 uint8_t packet;
57 uint8_t state;
58 int unk_04;
62 uint32_t flags;
63 uint8_t xon_char;
64 uint8_t xoff_char;
65 uint16_t unk_1A;
66 int unk_1C;
67 uint8_t device_type;
68 uint8_t unk_21[3];
69 uint8_t rx_buffer[0x5C];
70 void (*on_connect)(int conn);
71#else
72 uint16_t dev_handle;
73 uint32_t packet;
74#ifdef X75
75 int handle_set;
76 int dev_handle_set;
77 int unk_10;
78#else
79 int in_use;
80 int unk_0C;
81#endif
82 int read_pending;
83 SDEV *sdev;
84 int sdev_param;
85 int xon_char;
86 int xoff_char;
87 uint32_t flags;
88 uint8_t device_type;
89 uint8_t unk[3];
90#endif
91};
92
96struct BTLP_CONN {
97 int conn;
98#ifdef NEWSGOLD
99 uint16_t mtu;
100 uint8_t type;
101 uint8_t channel;
102#else
103 uint8_t type;
104 uint8_t unk[3];
105#endif
106};
107
112 uint16_t cid;
113 uint16_t unk_02;
114 uint16_t unk_04;
115 uint16_t unk_06;
116 uint16_t unk_08;
117 uint16_t sig;
118 uint8_t unk_0C[12];
119};
120
121#ifdef NEWSGOLD
130__swi_begin(0x420)
131int BtAccessor_New(int cepid, int msg, int no_servers, int zero)
132__swi_end(0x420, BtAccessor_New, (cepid, msg, no_servers, zero));
133
138__swi_begin(0x421)
140__swi_end(0x421, BtAccessor_Delete, (oh));
141
147__swi_begin(0x422)
148uint32_t BTA_ObjMsg(void *ev)
149__swi_end(0x422, BTA_ObjMsg, (ev));
150
164__swi_begin(0x424)
165int BTA_Server_New(int oh, int proto, int master, int encrypt, int authenticate, int authorize, int rx_mtu, int tx_mtu, int tid)
166__swi_end(0x424, BTA_Server_New, (oh, proto, master, encrypt, authenticate, authorize, rx_mtu, tx_mtu, tid));
167
176__swi_begin(0x425)
177void BTA_Server_StartReq(int oh, int server, int sdp_record, int unk, int tid)
178__swi_end(0x425, BTA_Server_StartReq, (oh, server, sdp_record, unk, tid));
179
187__swi_begin(0x426)
188void BTA_Server_AcceptReq(int oh, int server, int enable, int tid)
189__swi_end(0x426, BTA_Server_AcceptReq, (oh, server, enable, tid));
190
197__swi_begin(0x427)
198void BTA_Server_StopReq(int oh, int server, int tid)
199__swi_end(0x427, BTA_Server_StopReq, (oh, server, tid));
200
206__swi_begin(0x428)
207void BTA_Server_Delete(int oh, int server)
208__swi_end(0x428, BTA_Server_Delete, (oh, server));
209
216__swi_begin(0x429)
217void BTA_Sdp_Converter_New(int oh, void *(*alloc)(unsigned int), void (*free)(void *))
218__swi_end(0x429, BTA_Sdp_Converter_New, (oh, alloc, free));
219
228__swi_begin(0x42A)
229int BTA_SdpRec_New(int oh, const uint8_t uuid[16], int proto, int channel)
230__swi_end(0x42A, BTA_SdpRec_New, (oh, uuid, proto, channel));
231
237__swi_begin(0x42B)
238void BTA_SdpRec_Delete(int oh, int record)
239__swi_end(0x42B, BTA_SdpRec_Delete, (oh, record));
240
247__swi_begin(0x42C)
248void BTA_Conn_CloseReq(int oh, int conn, int tid)
249__swi_end(0x42C, BTA_Conn_CloseReq, (oh, conn, tid));
250
255__swi_begin(0x42D)
256const uint8_t *BT_GetLocAddr(void)
257__swi_end(0x42D, BT_GetLocAddr, ());
258#endif
259
264__swi_begin(0x42E)
266__swi_end(0x42E, SDev_InitEndpoint, (ep));
267
273__swi_begin(0x42F)
274uint8_t *BT_GetLocalDevice(void)
275__swi_end(0x42F, BT_GetLocalDevice, ());
276
277#ifdef NEWSGOLD
285__swi_begin(0x430)
286void BT_SetSecurityCheck(int lo, int unk1, int unk2, int unk3)
287__swi_end(0x430, BT_SetSecurityCheck, (lo, unk1, unk2, unk3));
288#endif
289
294__swi_begin(0x8431)
296__swi_end(0x8431, RamSDevApps, ());
297
303__swi_begin(0x8432)
304uint16_t *RamBtBufferPool(void)
305__swi_end(0x8432, RamBtBufferPool, ());
306
307#ifdef NEWSGOLD
322__swi_begin(0x433)
323int BTA_Conn_New_L2CAP(int oh, const uint8_t addr[6], int sapi_type, int psm, int master, int encrypt, int authenticate, int rx_mtu, int tx_mtu, int tid)
324__swi_end(0x433, BTA_Conn_New_L2CAP, (oh, addr, sapi_type, psm, master, encrypt, authenticate, rx_mtu, tx_mtu, tid));
325
339__swi_begin(0x450)
340int BTA_Conn_New_RFCOMM(int oh, const uint8_t addr[8], int sapi_type, int channel, int master, int encrypt, int authenticate, int tid)
341__swi_end(0x450, BTA_Conn_New_RFCOMM, (oh, addr, sapi_type, channel, master, encrypt, authenticate, tid));
342
357__swi_begin(0x451)
358int BTA_ServiceSearch_StartReq(int oh, const uint8_t addr[8], const void *uuids, const uint16_t *attrs, int nattrs, int tid)
359__swi_end(0x451, BTA_ServiceSearch_StartReq, (oh, addr, uuids, attrs, nattrs, tid));
360
368__swi_begin(0x452)
369void BTA_ServiceSearch_StopReq(int oh, int remdev, int tid)
370__swi_end(0x452, BTA_ServiceSearch_StopReq, (oh, remdev, tid));
371#endif
372
380__swi_begin(0x453)
381unsigned BTA_SdpRec_GetChannel(const void *record, int rfcomm)
382__swi_end(0x453, BTA_SdpRec_GetChannel, (record, rfcomm));
383
384#ifdef NEWSGOLD
391__swi_begin(0x447)
392int BTA_DeviceListView_GetList(int oh, int type)
393__swi_end(0x447, BTA_DeviceListView_GetList, (oh, type));
394
401__swi_begin(0x448)
404
412__swi_begin(0x449)
413void BTA_DeviceListView_GetEntryReq(int oh, int list, int index, int tid)
414__swi_end(0x449, BTA_DeviceListView_GetEntryReq, (oh, list, index, tid));
415
421__swi_begin(0x44A)
422void BTA_DeviceListView_StopList(int oh, int list)
423__swi_end(0x44A, BTA_DeviceListView_StopList, (oh, list));
424
431__swi_begin(0x44B)
433__swi_end(0x44B, BTA_RemBtDeviceInfo_GetAddress, (oh, device));
434
441__swi_begin(0x44C)
443__swi_end(0x44C, BTA_RemBtDeviceInfo_GetName, (oh, device));
444
452__swi_begin(0x45F)
453void BTA_Conn_GetL2CAPParamReq(int oh, int conn, int tid)
454__swi_end(0x45F, BTA_Conn_GetL2CAPParamReq, (oh, conn, tid));
455
462__swi_begin(0x460)
464__swi_end(0x460, BTA_Conn_GetRemDevInfo, (oh, conn));
465
473__swi_begin(0x461)
474uint32_t BTA_RemBtDeviceInfo_GetStatus(int oh, const CA_REMDEV *device, int what)
475__swi_end(0x461, BTA_RemBtDeviceInfo_GetStatus, (oh, device, what));
476
482__swi_begin(0x462)
483void BTA_AclDisconnectReq(int tid, const uint8_t addr[6])
484__swi_end(0x462, BTA_AclDisconnectReq, (tid, addr));
485
492__swi_begin(0x4AE)
493void BTA_DeviceDiscovery_StartSearchReq(int oh, uint32_t service, int tid)
494__swi_end(0x4AE, BTA_DeviceDiscovery_StartSearchReq, (oh, service, tid));
495
496#ifdef ELKA
504__swi_begin(0x4AF)
505void BTA_DeviceDiscovery_StartSearchCodReq(int oh, uint32_t cod_class, uint32_t iac, int tid)
506__swi_end(0x4AF, BTA_DeviceDiscovery_StartSearchCodReq, (oh, cod_class, iac, tid));
507#else
516__swi_begin(0x4AF)
517void BTA_DeviceDiscovery_StartSearchCodReq(int oh, uint32_t cod, uint32_t cod_mask, uint32_t iac, int tid)
518__swi_end(0x4AF, BTA_DeviceDiscovery_StartSearchCodReq, (oh, cod, cod_mask, iac, tid));
519#endif
520
526__swi_begin(0x4B0)
529
537__swi_begin(0x4B1)
538int BTA_RemBtDeviceInfo_SetName(int oh, CA_REMDEV *device, const char *name)
539__swi_end(0x4B1, BTA_RemBtDeviceInfo_SetName, (oh, device, name));
540
547__swi_begin(0x4B2)
550
557__swi_begin(0x4B3)
558void BTA_LocBtDevice_SetVisibilityReq(int oh, uint32_t visibility, int tid)
559__swi_end(0x4B3, BTA_LocBtDevice_SetVisibilityReq, (oh, visibility, tid));
560
567__swi_begin(0x4B4)
568void BTA_LocBtDevice_SetDIACReq(int oh, uint32_t diac, int tid)
569__swi_end(0x4B4, BTA_LocBtDevice_SetDIACReq, (oh, diac, tid));
570
577__swi_begin(0x4B5)
578void BTA_LocBtDevice_SetNameReq(int oh, const char *name, int tid)
579__swi_end(0x4B5, BTA_LocBtDevice_SetNameReq, (oh, name, tid));
580
587__swi_begin(0x4B6)
588uint32_t BTA_Conn_GetSapiApp(int oh, int conn)
589__swi_end(0x4B6, BTA_Conn_GetSapiApp, (oh, conn));
590
601__swi_begin(0x4B7)
602int BTA_ServiceSearch_RetrieveServiceReq(int oh, uint32_t device, uint32_t record, void *param4, int param5, int tid)
603__swi_end(0x4B7, BTA_ServiceSearch_RetrieveServiceReq, (oh, device, record, param4, param5, tid));
604
605#endif
606
612__swi_begin(0x4B8)
613uint32_t JSApi_CurrentHandleID(int conn)
614__swi_end(0x4B8, JSApi_CurrentHandleID, (conn));
615
620__swi_begin(0x4B9)
622__swi_end(0x4B9, JSApi_InitHandles, ());
623
632__swi_begin(0x4BA)
633int JSApi_RegisterConHandle(int conn, uint32_t packet, void (*on_connect)(int conn))
634__swi_end(0x4BA, JSApi_RegisterConHandle, (conn, packet, on_connect));
635
636#ifdef NEWSGOLD
644__swi_begin(0x4BB)
646__swi_end(0x4BB, JSApi_GetConnectionState, (conn));
647#endif
648
657__swi_begin(0x4BC)
658int JSApi_ReadBytes(int conn, void *buffer, uint32_t size)
659__swi_end(0x4BC, JSApi_ReadBytes, (conn, buffer, size));
660
667__swi_begin(0x4BD)
669__swi_end(0x4BD, JSApi_BytesAvailable, (conn));
670
679__swi_begin(0x4BE)
680int JSApi_WriteBytes(int conn, const void *data, uint32_t size)
681__swi_end(0x4BE, JSApi_WriteBytes, (conn, data, size));
682
689__swi_begin(0x4BF)
692
697__swi_begin(0x4C0)
699__swi_end(0x4C0, BTLP_InitL2CAP_IO, ());
700
709__swi_begin(0x4C1)
710int BTLP_uiSendDataOverBT(const void *data, uint32_t size, int sapi)
711__swi_end(0x4C1, BTLP_uiSendDataOverBT, (data, size, sapi));
712
718__swi_begin(0x4C2)
720__swi_end(0x4C2, BTLP_vDataToAppCallback, (sapi));
721
728__swi_begin(0x4C3)
729void BTLP_vFlushBuffer(int mode, int sapi)
730__swi_end(0x4C3, BTLP_vFlushBuffer, (mode, sapi));
731
737__swi_begin(0x4C4)
738void L2CA_ReadDataReq(const void *message)
739__swi_end(0x4C4, L2CA_ReadDataReq, (message));
740
747__swi_begin(0x4C5)
748void SApp_Register(int handler_id, const SDEV_APP *methods)
749__swi_end(0x4C5, SApp_Register, (handler_id, methods));
750
759__swi_begin(0x4C6)
760int ConnSDevSApp(uint32_t sdevice, uint32_t handler_id, const void *connection_info)
761__swi_end(0x4C6, ConnSDevSApp, (sdevice, handler_id, connection_info));
762
772__swi_begin(0x4C7)
773int CHConnSApp(uint32_t handler_id, uint32_t instance, uint32_t new_handler_id, const void *connection_info)
774__swi_end(0x4C7, CHConnSApp, (handler_id, instance, new_handler_id, connection_info));
775
783__swi_begin(0x4C8)
784int Serial_CanOpenSApp(uint32_t handler_id, uint32_t instance)
785__swi_end(0x4C8, Serial_CanOpenSApp, (handler_id, instance));
786
791__swi_begin(0x4C9)
793__swi_end(0x4C9, Ca_SasSApp_Init, ());
794
799__swi_begin(0x84CA)
801__swi_end(0x84CA, RamJSApiConnections, ());
802
808__swi_begin(0x84CB)
810__swi_end(0x84CB, RamBtlpConnections, ());
811
817__swi_begin(0x84CC)
820
821/* Bluetooth CA layer: objects, message replicators (MR),
822 * L2CAP connections, the device list. */
823#ifndef NEWSGOLD
831__swi_begin(0x4CD)
832uint16_t CA_MR_New(int cepid, int msg, const char *file, int line)
833__swi_end(0x4CD, CA_MR_New, (cepid, msg, file, line));
834
839__swi_begin(0x4CE)
840void CA_MR_Subscribe(uint16_t mr, int code, int class_id)
841__swi_end(0x4CE, CA_MR_Subscribe, (mr, code, class_id));
842
847__swi_begin(0x4CF)
848void CA_MR_Stop(uint16_t mr)
849__swi_end(0x4CF, CA_MR_Stop, (mr));
850
855__swi_begin(0x4D0)
856void CA_MR_Done(uint16_t mr, void *object_message)
857__swi_end(0x4D0, CA_MR_Done, (mr, object_message));
858#endif
859
863__swi_begin(0x4D1)
864uint8_t CA_MR_Class(void)
865__swi_end(0x4D1, CA_MR_Class, ());
866
870__swi_begin(0x4D2)
871void CA_Release(uint16_t handle)
872__swi_end(0x4D2, CA_Release, (handle));
873
878__swi_begin(0x4D3)
879uint8_t CA_SapiConnClass(void)
880__swi_end(0x4D3, CA_SapiConnClass, ());
881
886__swi_begin(0x4D4)
887CA_REMDEV *CA_RemDev_New(const uint8_t bd_addr[6])
888__swi_end(0x4D4, CA_RemDev_New, (bd_addr));
889
893__swi_begin(0x4D5)
895__swi_end(0x4D5, CA_RemDev_Free, (remdev));
896
897#ifndef NEWSGOLD
904__swi_begin(0x4D6)
905uint16_t CA_L2CAP_New(uint16_t mr, CA_REMDEV *remdev, int sapi, int psm, int master, int encrypt, int authenticate, int rx_mtu, int tx_mtu)
906__swi_end(0x4D6, CA_L2CAP_New, (mr, remdev, sapi, psm, master, encrypt, authenticate, rx_mtu, tx_mtu));
907
912__swi_begin(0x4D7)
913int CA_Conn_Close(uint16_t conn, uint16_t owner)
914__swi_end(0x4D7, CA_Conn_Close, (conn, owner));
915#endif
916
921__swi_begin(0x4D8)
922uint16_t CA_DevList(uint16_t local_dev)
923__swi_end(0x4D8, CA_DevList, (local_dev));
924
929__swi_begin(0x4D9)
930uint8_t CA_DevListClass(void)
931__swi_end(0x4D9, CA_DevListClass, ());
932
933#ifndef NEWSGOLD
939__swi_begin(0x4DA)
940void CA_DevList_CountReq(uint16_t list, uint16_t mr, int type)
941__swi_end(0x4DA, CA_DevList_CountReq, (list, mr, type));
942
948__swi_begin(0x4DB)
949void CA_DevList_EntryReq(uint16_t list, uint16_t mr, int type, int index)
950__swi_end(0x4DB, CA_DevList_EntryReq, (list, mr, type, index));
951#endif
952
956__swi_begin(0x4DC)
957uint16_t CA_LocalRoot(void)
958__swi_end(0x4DC, CA_LocalRoot, ());
959
963__swi_begin(0x4DD)
964uint16_t CA_LocalDev(uint16_t root, int zero)
965__swi_end(0x4DD, CA_LocalDev, (root, zero));
966
971__swi_begin(0x4DE)
972const uint8_t *CA_LocalAddr(uint16_t local_dev)
973__swi_end(0x4DE, CA_LocalAddr, (local_dev));
974
976
#define __swilib_begin
Definition doxygen.h:29
#define __swi_end(number, func, call)
Definition doxygen.h:33
#define __swi_begin(number)
Definition doxygen.h:32
#define __swilib_end
Definition doxygen.h:30
uint16_t unk_06
Definition bluetooth.h:115
int index
Endpoint callback instance.
Definition bluetooth.h:36
uint8_t state
See JSApi_GetConnectionState.
Definition bluetooth.h:57
uint8_t packet
0: RFCOMM stream, 1: L2CAP packets
Definition bluetooth.h:56
uint8_t unk_0C[12]
Definition bluetooth.h:118
uint8_t device_type
Type of the attached device, 0xFF = none.
Definition bluetooth.h:67
uint16_t sig
Signalling instance, 0xFFFF = none.
Definition bluetooth.h:117
int(* get_dev)(int index, int *inst)
Definition bluetooth.h:47
SDEV * sdev
Attached serial device.
Definition bluetooth.h:60
uint16_t unk_02
Definition bluetooth.h:113
uint8_t rx_buffer[0x5C]
Receive ring buffer (the data block is allocated on registration)
Definition bluetooth.h:69
int conn
Connection handle, 0 = free.
Definition bluetooth.h:97
uint16_t unk_08
Definition bluetooth.h:116
uint16_t unk_1A
Definition bluetooth.h:65
uint16_t cid
Local CID, 0x40 + entry index.
Definition bluetooth.h:112
int read_pending
A read callback is pending.
Definition bluetooth.h:59
uint8_t xoff_char
Definition bluetooth.h:64
uint32_t flags
Definition bluetooth.h:62
void * fn[15]
Callback table.
Definition bluetooth.h:32
uint8_t type
Device type.
Definition bluetooth.h:33
uint16_t handle
Connection handle, 0xFFFE = free.
Definition bluetooth.h:54
void(* on_connect)(int conn)
See JSApi_RegisterConHandle.
Definition bluetooth.h:70
uint8_t channel
Channel number.
Definition bluetooth.h:101
int settings_pending
flags, xon_char and xoff_char are to be applied
Definition bluetooth.h:61
void * unk
Definition bluetooth.h:45
int inst
Device callback instance.
Definition bluetooth.h:34
void(* reg)(SDEV *dev, const void *info)
Definition bluetooth.h:44
uint8_t xon_char
Definition bluetooth.h:63
uint16_t unk_04
Definition bluetooth.h:114
int(* open)(SDEV **ep, int dev_type, const uint8_t *info)
Definition bluetooth.h:43
void(* close)(int index)
Definition bluetooth.h:46
uint16_t mtu
Maximum packet size.
Definition bluetooth.h:99
uint8_t unk_21[3]
Definition bluetooth.h:68
uint8_t app
Application ID.
Definition bluetooth.h:35
uint8_t type
Service type, selected by the PSM.
Definition bluetooth.h:100
void Ca_SasSApp_Init(void)
Initialise the SIM Access Profile server and register it as SDev application 0x13.
void BTA_LocBtDevice_SetNameReq(int oh, const char *name, int tid)
Set the phone's Bluetooth name (asynchronous).
const uint8_t * BTA_RemBtDeviceInfo_GetAddress(int oh, const CA_REMDEV *device)
Read the Bluetooth address from a returned remote-device object.
CA_REMDEV * BTA_Conn_GetRemDevInfo(int oh, int conn)
Get the remote-device object of an open connection.
uint8_t CA_SapiConnClass(void)
Object class of SAPI connection events (opened, closed, failed, parameters).
int BTA_ServiceSearch_RetrieveServiceReq(int oh, uint32_t device, uint32_t record, void *param4, int param5, int tid)
Request an SDP service record of a remote device (asynchronous).
uint8_t CA_MR_Class(void)
Object class of the replicator's own events.
int BTA_Server_New(int oh, int proto, int master, int encrypt, int authenticate, int authorize, int rx_mtu, int tx_mtu, int tid)
Create an RFCOMM or L2CAP server under an accessor.
void BTA_ServiceSearch_StopReq(int oh, int remdev, int tid)
Cancel a running service search.
int JSApi_ReadBytes(int conn, void *buffer, uint32_t size)
Read received data of a JSApi connection.
const char * BTA_RemBtDeviceInfo_GetName(int oh, const CA_REMDEV *device)
Read the name from a returned remote-device object.
int CHConnSApp(uint32_t handler_id, uint32_t instance, uint32_t new_handler_id, const void *connection_info)
Move an open device connection from one SDev application to another.
void BTA_DeviceListView_StopList(int oh, int list)
Close a Bluetooth device-list view.
const uint8_t * BT_GetLocAddr(void)
Get the local Bluetooth address.
int JSApi_BytesAvailable(int conn)
Get the number of received bytes waiting in a JSApi connection.
CA_REMDEV * CA_RemDev_New(const uint8_t bd_addr[6])
Create a remote device object for a 6-byte BT address.
void BTLP_InitL2CAP_IO(void)
Initialise the L2CAP port devices: 9 on NSG/ELKA (SAPI 0x0D..0x15), 4 on SG/X75 (SAPI 0x08....
void BTA_Server_AcceptReq(int oh, int server, int enable, int tid)
Enable or disable incoming connections on a Bluetooth server.
void BTA_Conn_CloseReq(int oh, int conn, int tid)
Request asynchronous closure of a Bluetooth connection.
void JSApi_InitHandles(void)
Initialise the JSApi slots once and register JSApi as an SDev application.
int Serial_CanOpenSApp(uint32_t handler_id, uint32_t instance)
Check whether an SDev application would accept a connection (opens and closes it again).
void SApp_Register(int handler_id, const SDEV_APP *methods)
Register an SDev application (serial data endpoint) in the application table.
void SDev_InitEndpoint(SDEV *ep)
Initialize an SDev endpoint with the firmware default callbacks.
uint8_t * BT_GetLocalDevice(void)
Get the native local Bluetooth device object.
BTLP_CONN * RamBtlpConnections(void)
Get the BTLP (Bluetooth L2CAP port) connection table.
int BtAccessor_New(int cepid, int msg, int no_servers, int zero)
Create a Bluetooth accessor.
JSAPI_CONN * RamJSApiConnections(void)
Get the JSApi (Java Bluetooth) connection slots.
void BTA_DeviceListView_GetEntryReq(int oh, int list, int index, int tid)
Request a stored Bluetooth device entry asynchronously.
void BTA_LocBtDevice_SetDIACReq(int oh, uint32_t diac, int tid)
Set the inquiry access code (DIAC) the phone answers to (asynchronous).
void BTA_Sdp_Converter_New(int oh, void *(*alloc)(unsigned int), void(*free)(void *))
Set allocator callbacks for accessor SDP records.
void * BTA_RemBtDeviceInfo_GetDeviceClass(int oh, CA_REMDEV *device)
Get the class-of-device record of a remote-device object.
uint16_t * RamBtBufferPool(void)
Get the native Bluetooth buffer-pool status.
void BTA_LocBtDevice_SetVisibilityReq(int oh, uint32_t visibility, int tid)
Set the visibility of the phone's Bluetooth (asynchronous).
uint16_t CA_DevList(uint16_t local_dev)
Device list object of the local BT device.
const SDEV_APP ** RamSDevApps(void)
Get the SDev application callback table.
int BTA_RemBtDeviceInfo_SetName(int oh, CA_REMDEV *device, const char *name)
Set the name stored in a remote-device object.
int BTA_DeviceListView_GetList(int oh, int type)
Open a view of the stored Bluetooth device list.
void BTA_DeviceDiscovery_StartSearchReq(int oh, uint32_t service, int tid)
Start a Bluetooth device search (asynchronous).
void BTLP_vDataToAppCallback(int sapi)
Deliver received packets queued on an L2CAP port to its application until it stops taking them.
uint32_t JSApi_CurrentHandleID(int conn)
Find the JSApi (Java Bluetooth) slot of a connection handle.
void BTA_Server_Delete(int oh, int server)
Delete a stopped Bluetooth server.
void BTA_Server_StopReq(int oh, int server, int tid)
Request asynchronous stop of a Bluetooth server.
void BTLP_vFlushBuffer(int mode, int sapi)
Drop the received packets queued on an L2CAP port.
void BTA_Server_StartReq(int oh, int server, int sdp_record, int unk, int tid)
Start a Bluetooth server and publish its SDP record.
void BTA_DeviceDiscovery_StopSearchReq(int oh, int tid)
Stop a running Bluetooth device search (asynchronous).
void BTA_DeviceDiscovery_StartSearchCodReq(int oh, uint32_t cod_class, uint32_t iac, int tid)
Start a Bluetooth device search filtered by class of device (asynchronous).
uint8_t CA_DevListClass(void)
Object class of device list answers.
int JSApi_RegisterConHandle(int conn, uint32_t packet, void(*on_connect)(int conn))
Register a connection handle in a free JSApi slot.
L2CAP_CHANNEL * RamL2capChannelState(void)
Get the L2CAP channel table.
void BTA_Conn_GetL2CAPParamReq(int oh, int conn, int tid)
Request the L2CAP parameters of an open connection.
struct CA_REMDEV CA_REMDEV
Remote Bluetooth device object (CA layer), also used by the BTA_RemBtDeviceInfo_* functions.
Definition bluetooth.h:26
void CA_RemDev_Free(CA_REMDEV *remdev)
Free a remote device object.
void BTA_AclDisconnectReq(int tid, const uint8_t addr[6])
Drop the ACL link to a remote device (asynchronous).
void L2CA_ReadDataReq(const void *message)
L2CAP handler of the L2CA_ReadDataReq signal.
uint32_t BTA_RemBtDeviceInfo_GetStatus(int oh, const CA_REMDEV *device, int what)
Read the link status of a remote device.
int JSApi_ClearConnectionHandle(int conn)
Free the JSApi slot of a connection handle and its receive buffer.
void CA_Release(uint16_t handle)
Release a CA object handle (replicator, connection).
void BT_SetSecurityCheck(int lo, int unk1, int unk2, int unk3)
Set the local Bluetooth connection security level.
int BTA_ServiceSearch_StartReq(int oh, const uint8_t addr[8], const void *uuids, const uint16_t *attrs, int nattrs, int tid)
Search the SDP records of a remote device (what JSR-82 searchServices uses).
unsigned BTA_SdpRec_GetChannel(const void *record, int rfcomm)
Server channel from an SDP record's ProtocolDescriptorList.
uint16_t CA_LocalRoot(void)
Root object of the local BT stack.
int BTA_Conn_New_L2CAP(int oh, const uint8_t addr[6], int sapi_type, int psm, int master, int encrypt, int authenticate, int rx_mtu, int tx_mtu, int tid)
Open an outgoing L2CAP connection.
int BTA_SdpRec_New(int oh, const uint8_t uuid[16], int proto, int channel)
Create a Bluetooth SDP service record.
void BTA_SdpRec_Delete(int oh, int record)
Delete an accessor SDP record.
int JSApi_WriteBytes(int conn, const void *data, uint32_t size)
Send data over a JSApi connection.
int BTA_DeviceListView_GetNumberOfEntries(int oh, int list)
Count entries in a Bluetooth device-list view.
int BTA_Conn_New_RFCOMM(int oh, const uint8_t addr[8], int sapi_type, int channel, int master, int encrypt, int authenticate, int tid)
Open an outgoing RFCOMM (SPP) connection to a remote device, client role.
uint8_t JSApi_GetConnectionState(int conn)
Get the state of a JSApi connection.
int BTLP_uiSendDataOverBT(const void *data, uint32_t size, int sapi)
Send data over an L2CAP port: one buffer per packet from the shared stack pool.
uint16_t CA_LocalDev(uint16_t root, int zero)
Local BT device object.
uint32_t BTA_Conn_GetSapiApp(int oh, int conn)
Get the SAPI application of an open connection.
void BtAccessor_Delete(int oh)
Delete a Bluetooth accessor after closing its connections and servers.
uint32_t BTA_ObjMsg(void *ev)
Read the Bluetooth event identifier from an accessor event object.
int ConnSDevSApp(uint32_t sdevice, uint32_t handler_id, const void *connection_info)
Connect a serial device to an SDev application.
const uint8_t * CA_LocalAddr(uint16_t local_dev)
BT address of the local device object.
BTLP connection (see RamBtlpConnections).
Definition bluetooth.h:96
JSApi connection slot (see RamJSApiConnections).
Definition bluetooth.h:53
L2CAP channel (see RamL2capChannelState).
Definition bluetooth.h:111
SDev endpoint.
Definition bluetooth.h:31
SDev application callbacks.
Definition bluetooth.h:42
void free(void *ptr)
Deallocate memory block.
#define const
Definition zconf.h:115