The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [xAP] Protocol revisions?



OK - re-read the proposed modifications in the light of trying to implement it over lunch, and one thing struck me.

The xAP-header construct DOESN'T have a <0x0A> after the closing braces.
The Outlook construct DOES.

I think that it's both or neither :-)

I've assume both, and here's the code fragment:

Mark

-------------------------




Private Sub Application_NewMail()

'Work out how many messages there are in the inbox

Set oOutlook = New Outlook.Application
Set oNamespace = oOutlook.GetNamespace("MAPI")
Set oFolder = oNamespace.GetDefaultFolder(olFolderInbox)
UnreadMessagesInInbox = oFolder.UnReadItemCount
oUserName = oNamespace.CurrentUser

'Compare with the unread count in the registry to see if there's a change, and if so, broadcast it

If Trim$(Str$(UnreadMessagesInInbox)) <> ReadRegistry("unreadcount") Then
    WriteRegistry "unreadcount", Trim$(Str$(UnreadMessagesInInbox))
    'So broadcast it :-)
   
    xAPMessageBody = "<STX>"
    xAPMessageBody = xAPMessageBody & "xAP-header {" & Chr$(10)
    xAPMessageBody = xAPMessageBody & "hop=1" & Chr$(10)
    xAPMessageBody = xAPMessageBody & "source=Outlook" & Chr$(10)
    xAPMessageBody = xAPMessageBody & "instance=" & oUserName & Chr$(10)
    xAPMessageBody = xAPMessageBody & "}" & Chr$(10)
   
    xAPMessageBody = xAPMessageBody & "Outlook {" & Chr$(10)
    xAPMessageBody = xAPMessageBody & "unread=" & Trim$(Str$(UnreadMessagesInInbox)) & Chr$(10)
    xAPMessageBody = xAPMessageBody & "}" & Chr$(10)
    xAPMessageBody = xAPMessageBody & "<ETX>"
   
    MsgBox xAPMessageBody
    'OK, so it's currently popping up a MsgBox rather than broadcasting, but, heh :-)
   
   
End If


End Sub


Yahoo! Groups Sponsor
ADVERTISEMENT

For more information: http://www.automatedhome.co.uk
Post message: ukha_d@xxxxxxx
Subscribe:  ukha_d-subscribe@xxxxxxx
Unsubscribe:  ukha_d-unsubscribe@xxxxxxx
List owner:  ukha_d-owner@xxxxxxx

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.