Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

WISE Unregister Service

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: ebra (10 Apr 2008)
Last edited: hamishwillee (30 May 2013)

Unregister service

sdp_record_unregister(session,record);
sdp_close(session);
// delete out record from service discovery database
sdpDB.DeleteRecordL(record);
 
// close sdp and sdp db sessions
sdpDB.Close();
sdp.Close();

Complete WISE functions

typedef struct 
{
int registered; /* Server registered to the SDP server */
int server_connected; /* Server connected to a client */
int client_connected; /* Server socket active */
sdp_session_t* session; /* SDP session */
sdp_record_t* record; /* SDP record */
int server_socket; /* Server socket */
int client_socket; /* Client socket */
char client_address[18]; /* Client Bluetooth address */
} wise_server;
void server_close_connection(wise_server* server)
{
if ( server->client_connected )
{
close(server->client_socket);
server->client_connected = FALSE;
}
if ( server->registered )
{
sdp_record_unregister(server->session,server->record);
sdp_close(server->session);
server->registered = FALSE;
}
if ( server->server_connected )
{
close(server->server_socket);
server->server_connected = FALSE;
}
}
class CWISEServer : public CActive, public CWISEBase
{
public:
...
 
void StopAdvertiserL();
 
...
private: // data
 
// service discovery protocol session
RSdp iSdp;
 
// service discovery database (sdp)
RSdpDatabase iSdpDB;
 
// service record
TSdpServRecordHandle iRecord;
 
// service record state
TInt iRecordState;
};
void CWISEServer::StopAdvertiserL()
{
if ( iRecord!=0 )
{
// delete out record from service discovery database
iSdpDB.DeleteRecordL(iRecord);
// close sdp and sdp db sessions
iSdpDB.Close();
iSdp.Close();
iRecord=0;
}
}


Links

This page was last modified on 30 May 2013, at 06:39.
68 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×