Exemple #1
0
        private ObexGetStream PullvCardListing(PbapFolder Folder, int MaxListCount, int ListStartOffset, string PhoneNumber = "")
        {
            session.SetPathReset();
            session.SetPath("telecom");

            ObexHeaderCollection headers = new ObexHeaderCollection();

            headers.AddType("x-bt/vcard-listing");
            headers.Add(ObexHeaderId.Name, Folder.Name());


            List <byte> paramList = new List <byte>();

            paramList.AddRange(new byte[] { 0x01, 0x01, 0x01 }); // Order

            byte[] searchValue = UTF8Encoding.UTF8.GetBytes(PhoneNumber);
            if (!String.IsNullOrWhiteSpace(PhoneNumber))
            {
                paramList.AddRange(new byte[] { 0x02, (byte)searchValue.Length });
                paramList.AddRange(searchValue);                                                                          // SearchValue
            }

            paramList.AddRange(new byte[] { 0x03, 0x01, 0x01,                                                                 // SearchAttribute 0x00:Name 0x01:Number 0x02:Sound
                                            0x04, 0x02, (byte)((MaxListCount >> 8) & 0xFF), (byte)(MaxListCount & 0xFF),      // MaxListCount
                                            0x05, 0x02, (byte)((ListStartOffset >> 8) & 0xFF), (byte)(ListStartOffset & 0xFF) // ListStartOffset
                               });
            headers.Add(ObexHeaderId.AppParameters, paramList.ToArray());

            return(session.Get(headers));
        }
Exemple #2
0
        private ObexGetStream PullvCardEntry(PbapFolder Folder, string ObjectName)
        {
            session.SetPath(Folder.Name());

            ObexHeaderCollection headers = new ObexHeaderCollection();

            headers.AddType("x-bt/vcard");
            headers.Add(ObexHeaderId.Name, ObjectName);

            return(session.Get(headers));
        }
Exemple #3
0
        private ObexGetStream PullPhoneBook(PbapFolder Folder, int MaxListCount, int ListStartOffset)
        {
            ObexHeaderCollection headers = new ObexHeaderCollection();

            headers.AddType("x-bt/phonebook");
            headers.Add(ObexHeaderId.Name, Folder.FullPath());

            headers.Add(ObexHeaderId.AppParameters, new byte[] {
                0x06, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                 // Filter
                0x07, 0x01, 0x01,                                                                           // Format 0x00 = 2.1 0x01 = 3.0
                0x04, 0x02, (byte)((MaxListCount >> 8) & 0xFF), (byte)(MaxListCount & 0xFF),                // MaxListCount
                0x05, 0x02, (byte)((ListStartOffset >> 8) & 0xFF), (byte)(ListStartOffset & 0xFF)
            });                                                                                             // ListStartOffset

            return(session.Get(headers));
        }