00001 //-*-c++-*- 00002 /*************************************************************************** 00003 * Copyright (C) 2003 by Fred Schaettgen * 00004 * kdebluetooth@schaettgen.de * 00005 * * 00006 * This program is free software; you can redistribute it and/or modify * 00007 * it under the terms of the GNU General Public License as published by * 00008 * the Free Software Foundation; either version 2 of the License, or * 00009 * (at your option) any later version. * 00010 ***************************************************************************/ 00011 00012 #ifndef SDPSERVICE_H 00013 #define SDPSERVICE_H 00014 00015 #include <qvector.h> 00016 #include <qarray.h> 00017 #include <OTSDPAttribute.h> 00018 00019 namespace Opietooth2 { 00020 00024 class OTSDPService { 00025 00026 public: 00027 00028 OTSDPService(); 00029 virtual ~OTSDPService(); 00030 00031 void addAttribute(int id, OTSDPAttribute * attr); 00032 00033 const OTSDPAttribute & attribute( int index ); 00034 int attributeID( int index ); 00035 00036 AttributeVector subAttributes( OTSDPAttribute * attr); 00037 OTSDPAttribute * attributeByID( int id ); 00038 00039 // See Bluetooth Core Spec Sec. 5.1 00040 bool recordHandle(uint32_t *handle); // 0x00 00041 00042 //bool getServiceClassIDList(vector<uuid_t> *classIDList); // 0x01 00043 //bool getServiceRecordState(uint32_t *state); // 0x02 00044 //bool getServiceID(uuid_t *id); // 0x03; 00045 //bool getProtocolDescriptorList(SDP::Attribute *attribute); // 0x04 00046 //bool getBrowseGroupList(vector<uuid_t> *browseGroupList); // 0x05 00047 QString name(void); // langBase + 0x00 00048 QString description(void); // langBase + 0x01 00049 00050 UUIDVector allUUIDs(); 00051 00052 // return list of classes this service belongs to 00053 UUIDVector classIDList(); 00054 00059 bool rfcommChannel(unsigned int &n); 00060 00061 bool hasClassID(const OTUUID & uuid); 00062 00063 private: 00064 00065 struct AttributeEntry { 00066 int id; 00067 OTSDPAttribute * attr; 00068 }; 00069 00070 QArray<AttributeEntry> attributeList; 00071 }; 00072 00073 } 00074 00075 #endif
1.4.2