SWRU580 April 2021 CC2564C , CC2564MODA , CC2564MODN
Description
The following function is responsible for creating a local PBAP Server. This function returns zero if successful and a negative value if an error occurred.
Parameters
The command only requires one parameter. This parameter is the Port Number.
Command Call Examples
"Open 1" Attempts to Open a PBA Port Server at Port Number #1".
Possible Return Values
(0)PBAP_Register_Server_SDP_Record
(-4) FUNCTION_ERROR
(-9) UNABLE_TO_REGISTER_SERVER
(-67) BTPS_ERROR_RFCOMM_NOT_INITIALIZED
(-85) BTPS_ERROR_SPP_NOT_INITIALIZED
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Open_Server_Port(BluetoothStackID, TempParam->Params[0].intParam, (PBAP_SUPPORTED_REPOSITORIES_LOCAL_PHONEBOOK), PBAP_Event_Callback_Server, 0)
API Prototype
int BTPSAPI PBAP_Open_Server_Port(unsigned int BluetoothStackID, unsigned int ServerPort, Byte_t SupportedRepositories, PBAP_Event_Callback_t EventCallback, unsigned long CallbackParameter)
Description of API
The following function is responsible for opening a local PBAP Server. The first parameter is the Bluetooth Stack ID on which to open the Server. The second parameter is the Port on which to open this Server, and *MUST* be between PBAP_PORT_NUMBER_MINIMUM and PBAP_PORT_NUMBER_MAXIMUM. The third parameter is a bitmask which determines which repositories are supported by this Server instance. The fourth parameter is the Callback function to call when an event occurs on this Server Port. The final parameter is a user-defined callback parameter that will be passed to the callback function with each event. This function returns a positive, non zero value if successful or a negative return error code if an error occurs. A successful return code will be a PBAP Profile ID that can be used to reference the Opened PBAP Profile Server Port in ALL other PBAP Server functions in this module. Once an PBAP Profile Server is opened, it can only be Un-Registered via a call to the PBAP_Close_Server() function (passing the return value from this function).
Description
The following function is responsible for deleting a local PBAP Server that was created via a successful call to the OpenServer() function. This function returns zero if successful and a negative value if an error occurred.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the Server closing.
Possible Return Values
(0) Successfully Closed Server
(-4) FUNCTION_ERROR
(-2) BTPS_ERROR_INVALID_BLUETOOTH_STACK_ID
(-67) BTPS_ERROR_RFCOMM_NOT_INITIALIZED
(-85) BTPS_ERROR_SPP_NOT_INITIALIZED
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Close_Server_Port(BluetoothStackID, PBAPID);
API Prototype
int BTPSAPI PBAP_Close_Server_Port(unsigned int BluetoothStackID, unsigned int PBAPID)
Description of API
The following function is responsible for closing a PBAP Profile Server (which was opened by a successful call to the PBAP_Open_Server_Port() function). The first parameter is the Bluetooth Stack ID of the previously opened Server port. The second parameter is the PBAP ID returned from the previous call to PBAP_Open_Server_Port(). This function returns zero if successful, or a negative return error code if an error occurred (see BTERRORS.H). Note that this function does NOT delete any SDP Service Record Handles.
Description
The following function is responsible for initiating a connection with a Remote PBAP Server. This function returns zero if successful and a negative value if an error occurred.
Parameters
The command takes two parameters to work. The first is the Inquiry Index which can be found using the DisplayInquiryList command after an Inquiry has been completed. The second is the RFCOMM Server Port which will be used to open a Remote PBAP Port.
Command Call Examples
"Open 12 4" Attempts to Open a Remote PhoneBook Port Server with the Remote Bluetooth Device whose address is found at the twelfth Inquiry Index using RFCOMM Server Port #4."
"Open 1 1" Attempts to Open a Remote PhoneBook Port Server with the Remote Bluetooth Device whose address is found at the first Inquiry Index using RFCOMM Server Port #1."
"Open 19 3" Attempts to Open a Remote PhoneBook Port Server with the Remote Bluetooth Device whose address is found at the nineteenth Inquiry Index using RFCOMM Server Port #3. "
Possible Return Values
(0) PBAP_Open_Remote_Server_Port: Function Successful
(-67) BTPS_ERROR_RFCOMM_NOT_INITIALIZED
(-72) BTPS_ERROR_RFCOMM_UNABLE_TO_CONNECT_TO_REMOTE_DEVICE
(-73) BTPS_ERROR_RFCOMM_UNABLE_TO_COMMUNICATE_WITH_REMOTE_DEVICE
(-85) BTPS_ERROR_SPP_NOT_INITIALIZED
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Open_Remote_Server_Port(BluetoothStackID, InquiryResultList[(TempParam->Params[0].intParam-1)], TempParam->Params[1].intParam, PBAP_Event_Callback_Client, 0);
API Prototype
int BTPSAPI PBAP_Open_Remote_Server_Port(unsigned int BluetoothStackID, BD_ADDR_t BD_ADDR, unsigned int ServerPort, PBAP_Event_Callback_t EventCallback, unsigned long CallbackParameter)
Description of API
The following function is responsible for opening a connection to a remote PBAP Server. The first parameter is the Bluetooth Stack ID of the local Bluetooth stack. The second parameter is the remote Bluetooth Device Address of the Bluetooth PBAP Profile Server with which to connect. The third parameter specifies the remote Server port with which to connect. The final two parameters specify the PBAP Profile Event Callback Function and the Callback Parameter to associate with this PBAP Profile Client. The ServerPort parameter *MUST* be between PBAP_PORT_NUMBER_MINIMUM and PBAP_PORT_NUMBER_MAXIMUM. This function returns a positive, non zero, value if successful or a negative return error code if an error occurs. A successful return code will be a PBAP ID that can be used to reference the remote opened PBAP Profile Server in ALL other PBAP Profile Client functions in this module. Once a remote Server is opened, it can only be closed via a call to the PBAP_Close_Connection() function (passing the return value from this function).
Description
The following function is responsible for terminating a connection with a remote PBAP Client or Server. This function returns zero if successful and a negative value if an error occurred.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the Server closing.
Possible Return Values
(0) PBAP_Open_Remote_Server_Port: Function Successful
(-4) FUNCTION_ERROR
(-67) BTPS_ERROR_RFCOMM_NOT_INITIALIZED
(-73) BTPS_ERROR_RFCOMM_UNABLE_TO_COMMUNICATE_WITH_REMOTE_DEVICE
(-85) BTPS_ERROR_SPP_NOT_INITIALIZED
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Close_Connection(BluetoothStackID, PBAPID);
API Prototype
BTPSAPI PBAP_Close_Connection(unsigned int BluetoothStackID, unsigned int PBAPID)
Description of API
The following function is responsible for closing a currently ongoing PBAP Profile connection. The first parameter is the Bluetooth Stack ID of the Bluetooth Protocol Stack Instance that is associated with the PBAP Profile connection being closed. The second parameter to this function is the PBAP ID of the PBAP Profile connection to be closed. This function returns zero if successful, or a negative return value if there was an error.
Description
The following function is responsible for terminating a connection with a remote PBAP Server by issuing an OBEX Disconnect. This function returns zero if successful and a negative value if an error occurred.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the Server closing.
Possible Return Values
(0) PBAP_Disconnect_Request: Function Successful
(-4) FUNCTION_ERROR
(-6) INVALID_PARAMETERS_ERROR
(-73) BTPS_ERROR_RFCOMM_UNABLE_TO_COMMUNICATE_WITH_REMOTE_DEVICE
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Disconnect_Request(BluetoothStackID, PBAPID);
API Prototype
int BTPSAPI PBAP_Disconnect_Request(unsigned int BluetoothStackID, unsigned int PBAPID)
Description of API
The following function is responsible for sending an Disconnect Request to the remote device/entity. The first parameter to this function is the Bluetooth Stack ID of the Bluetooth Protocol Stack Instance that is associated with the PBAP Profile connection being disconnected. The second parameter to this function is the PBAP ID of the PBAP Profile connection to be disconnected (that was returned by a call to PBAP_Open_Remote_Server_Port()). This function returns zero if successful, or a negative return value if there was an error.
Description
The following function is responsible for issuing a PBAP Pull Phonebook Request with a remote PBAP Server. This function returns zero if successful and a negative value if an error occurred.
Parameters
The command requires 3 parameters, the Max List Count, the List Start Offset and the Phonebook Path.
Command Call Examples
"PullPhonebook 65535 0 telecom/pb.vcf has 65535 as the Max List Count, 0 as the List Start Offset and telecom/pb.vcf as the Phonebook Path.
Possible Return Values
(0) PBAP_Pull_Phonebook_Request: Function Successful
(-4) FUNCTION_ERROR
(-6) INVALID_PARAMETERS_ERROR
(-8) INVALID_STACK_ID_ERROR
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Set_Phonebook_Request(BluetoothStackID, PBAPID, (PBAP_Set_Path_Option_t)TempParam->Params[0].intParam, TempParam->Params[1].strParam);
API Prototype
int BTPSAPI PBAP_Pull_Phonebook_Request(unsigned int BluetoothStackID, unsigned int PBAPID, char *ObjectName, DWord_t FilterLow, DWord_t FilterHigh, PBAP_Format_t Format, Word_t MaxListCount, Word_t ListStartOffset)
Description of API
The following function generates a PBAP Pull Phonebook Request to the specified remote PBAP Server. The BluetoothStackID parameter the ID of the Bluetooth Stack that is associated with this PBAP Client. The PBAPID parameter specifies the PBAP ID for the local PBAP Client (returned from a successful call to the PBAP_Connect_Remote_Server_Port() function). The ObjectName parameter contains the Name/Path of the Phonebook being requested by this Pull Phonebook operation. The FilterLow parameter contains the lower 32 bits of the 64-bit filter attribute. The FilterHigh parameter contains the higher 32 bits of the 64-bit filter attribute. The Format parameter is an enumeration which specifies the vCard format requested in this Pull Phonebook request. If pfDefault is specified then the format will not be included in the request (note that the Server will default to pfvCard21 in this case). The MaxListCount parameter is an unsigned integer that specifies the maximum number of entries the Client can handle. A value of 65535 means that the number of entries is not restricted. A MaxListCount of ZERO (0) indicates that this is a request for the number of used indexes in the Phonebook specified by the ObjectName parameter. The ListStartOffset parameter specifies the index requested by the Client in this PullPhonebookRequest. This function returns zero if successful or a negative return error code if there was an error.
Description
The following function is responsible for issuing a PBAP Set Phonebook Request with a remote PBAP Server. This function returns zero if successful and a negative value if an error occurred.
Parameters
This functions requires two parameters; the path change requested and the path name. E.g If down is selected as the path option then we require an additional paramters which is the path.
Command Call Examples
"SetPhonebook 1 telecom goes down a level to the telecom folder.
Possible Return Values
(0) PBAP_Set_Phonebook_Request: Function Successful
(-4) FUNCTION_ERROR
(-6) INVALID_PARAMETERS_ERROR
(-8) INVALID_STACK_ID_ERROR
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Set_Phonebook_Request(BluetoothStackID, PBAPID, (PBAP_Set_Path_Option_t)TempParam->Params[0].intParam, TempParam->Params[1].strParam);
API Prototype
int BTPSAPI PBAP_Set_Phonebook_Request(unsigned int BluetoothStackID, unsigned int PBAPID, PBAP_Set_Path_Option_t PathOption, char *ObjectName)
Description of API
The following function generates a PBAP Set Phonebook Request to the specified remote PBAP Server. The BluetoothStackID parameter the ID of the Bluetooth Stack that is associated with this PBAP Client. The PBAPID parameter specifies the PBAP ID for the local PBAP Client (returned from a successful call to the PBAP_Connect_Remote_Server_Port() function). The PathOption parameter contains an enumerated value that indicates the type of path change to request. The ObjectName parameter contains the folder name to include with this Set Phonebook request. This value can be NULL if no name is required for the selected PathOption. See the PBAP specification for more information. This function returns zero if successful or a negative return error code if there was an error.
Description
The following function is responsible for issuing a PBAP Pull vCARD Listing Request with a remote PBAP Server. This function returns zero if successful and a negative value if an error occurred.
Parameters
The command requires 3 parameters, the Max List Count, the List Start Offset and the Phonebook Path.
Command Call Examples
"PullPhonebook 65535 0 pb has 65535 as the Max List Count, 0 as the List Start Offset and pb as the Phonebook Path. "
Possible Return Values
(0) PBAP_Pull_vCard_Listing_Request: Function Successful
(-4) FUNCTION_ERROR
(-6) INVALID_PARAMETERS_ERROR
(-8) INVALID_STACK_ID_ERROR
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Pull_vCard_Listing_Request(BluetoothStackID, PBAPID, Phonebook, loDefault, saDefault, NULL, (Word_t)TempParam->Params[0].intParam, (Word_t)TempParam->Params[1].intParam);
API Prototype
int BTPSAPI PBAP_Pull_vCard_Listing_Request(unsigned int BluetoothStackID, unsigned int PBAPID, char *ObjectName, PBAP_List_Order_t ListOrder, PBAP_Search_Attribute_t SearchAttribute, char *SearchValue, Word_t MaxListCount, Word_t ListStartOffset)
Description of API
The following function generates a PBAP Pull vCard Listing Request to the specified remote PBAP Server. The BluetoothStackID parameter the ID of the Bluetooth Stack that is associated with this PBAP Client. The PBAPID parameter specifies the PBAP ID for the local PBAP Client (returned from a successful call to the PBAP_Connect_Remote_Server_Port() function). The ObjectName parameter contains the folder of the Phonebook being requested by this Pull vCard Listing operation. This value can be NULL if a PhonebookSize request is being performed. The ListOrder parameter is an enumerated type that determines the optionally requested order of the listing. Using the 'loDefault' value for this parameter will prevent this field from being added to the request (note that the Server will default to loIndexed in this case). The SearchAttribute is an enumerated type that determines the optionally requested attribute used to filter this request. Using the 'saDefault' value for this parameter will prevent this field from being added to the request (note that the Server will default to saIndexed in this case). The SearchValue parameter contains an optional ASCII, Null-terminated character string that contains the string requested for search/filter. If this parameter is NULL, this field will be excluded from the request. The MaxListCount parameter is an unsigned integer that specifies the maximum number of list entries the Client can handle. A value of 65535 means that the number of entries is not restricted. A MaxListCount of ZERO (0) indicates that this is a request for the number of used indexes in the Phonebook specified by the ObjectName parameter. The ListStartOffset parameter specifies the index requested by the Client in this Pull vCard Listing. This function returns zero if successful or a negative return error code if there was an error.
Description
The following function is responsible for issuing a PBAP Pull vCARD Entry Request with a remote PBAP Server. This function returns zero if successful and a negative value if an error occurred.
Parameters
This function requires only one parameters, the vCard Name.
Command Call Examples
"PullvCARDEntry 0.vcf pulls the vcf file named 0."
Possible Return Values
(0) PBAP_Pull_vCard_Entry_Request: Function Successful
(-4) FUNCTION_ERROR
(-6) INVALID_PARAMETERS_ERROR
(-8) INVALID_STACK_ID_ERROR
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Pull_vCard_Entry_Request(BluetoothStackID, PBAPID, TempParam->Params[0].strParam, 0, 0, pfvCard21);
API Prototype
int BTPSAPI PBAP_Pull_vCard_Entry_Request(unsigned int BluetoothStackID, unsigned int PBAPID, char *ObjectName, DWord_t FilterLow, DWord_t FilterHigh, PBAP_Format_t Format)
Description of API
The following function generates a PBAP Pull vCard Entry Request to the specified remote PBAP Server. The BluetoothStackID parameter the ID of the Bluetooth Stack that is associated with this PBAP Client. The PBAPID parameter specifies the PBAP ID for the local PBAP Client (returned from a successful call to the PBAP_Connect_Remote_Server_Port() function). The ObjectName parameter contains the name of the Phonebook entry being requested by this Pull vCard Entry operation. The FilterLow parameter contains the lower 32 bits of the 64-bit filter attribute. The FilterHigh parameter contains the higher 32 bits of the 64-bit filter attribute. The Format parameter is an enumeration which specifies the vCard format requested in this Pull vCard Entry request. If pfDefault is specified then the format will not be included in the request (note that in this case the Server will default to pfvCard21 in this case). This function returns zero if successful or a negative return error code if there was an error.
Description
The following function is responsible for issuing an Abort with a remote PBAP Server by issuing an OBEX Abort Command. This function returns zero if successful and a negative value if an error occurred.
Parameters
It is not necessary to include parameters when using this command. A parameter will have no effect on the outcome of the Server closing.
Possible Return Values
(0) PBAP_Abort_Request: Function Successful
(-4) FUNCTION_ERROR
(-6) INVALID_PARAMETERS_ERROR
(-1000) BTPBAP_ERROR_INVALID_PARAMETER
(-1001) BTPBAP_ERROR_NOT_INITIALIZED
(-1002) BTPBAP_ERROR_INVALID_BLUETOOTH_STACK_ID
(-1003) BTPBAP_ERROR_LIBRARY_INITIALIZATION_ERROR
(-1004) BTPBAP_ERROR_INSUFFICIENT_RESOURCES
(-1005) BTPBAP_ERROR_REQUEST_ALREADY_OUTSTANDING
(-1006) BTPBAP_ERROR_ACTION_NOT_ALLOWED
API Call
PBAP_Abort_Request(BluetoothStackID, PBAPID);
API Prototype
int BTPSAPI PBAP_Abort_Request(unsigned int BluetoothStackID, unsigned int PBAPID)
Description of API
The following function is responsible for Aborting ANY currently outstanding PBAP Profile Client Request. The first parameter is the Bluetooth Stack ID of the Bluetooth Stack for which the PBAP Profile Client is valid. The second parameter to this function specifies the PBAP ID (returned from a successful call to the PBAP_Open_Remote_Server_Port() function). This function returns zero if successful, or a negative return error code if there was an error.