×
Namespaces

Variants
Actions
Revision as of 07:10, 26 July 2012 by hamishwillee (Talk | contribs)

WISE Unregister Service

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: ebra (10 Apr 2008)
Last edited: hamishwillee (26 Jul 2012)

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

61 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.

×