Skip to content

Centennial App for hosting AllJoyn device system bridge#9

Open
sanjaiganesh wants to merge 8 commits intotjaffri:developfrom
sanjaiganesh:develop
Open

Centennial App for hosting AllJoyn device system bridge#9
sanjaiganesh wants to merge 8 commits intotjaffri:developfrom
sanjaiganesh:develop

Conversation

@sanjaiganesh
Copy link

  • Adding Centennial app that hosts an App Service, which in turn hosts DSB.
  • updated test app to consume app service (optional)
  • Initialize AlJoyn by calling alljoyn_init(). DSB was crashing, esp in debug mode. This is a mandatory step that was missed.
  • Ensure Bridge solution builds in 'release' mode, in which centennial app is tested.

For detailed info, refer to README.md in BridgeHost project. Below is the summary.

There are two parts in the centennial app

  • BridgeHost : This project represents UWP portion fo the app that has hosts the app service, which in turns hosts the bridge (DSB).
  • BridgeHostStartupTask : This project is a win32 application that runs on startup (logon), starts the app service and holds on to it so that underlying AllJoyn bridge (DSB) is alive.

App service stores info (DeviceInfo) about previously onboarded devices in the application data, organized in the following application data container hierarchy.
This data gets deleted upon uninstall. Ideally, corresponding cloud service should store this information which app can sync to.
That will ensure devices appear on the bus even after uninstall/install and not required to be onboarded again.
The name of the child containers to 'OnboardedDevices' container is generated using (app service)client provided 'Category' (in valueset) concatenated with device ID.
This should change per final design.

  • OnboardedDevices
    • WinkThermoStat:'device id'
      • 'DeviceInfo'
    • WinkThermoStat:'device id'
      • 'DeviceInfo'
    • VeeraLightBulb:'device id'
      • 'DeviceInfo'
        This data is used when gets activated upon startup (logon) and onboards those devices.

The Ultimate effect is, user sees the devices (on AJ bus), even after restarting the machine. This is the magic we want.
Console or client app can come and onboard new devices and go. But Bridge/App services stays alive.
Startup task has the health check (does every 5 seconds) and starts app service if not UP.

@sanjaiganesh
Copy link
Author

sanjaiganesh commented Aug 16, 2016

@tjaffri @jasongin Please take a look. #Resolved

@sanjaiganesh
Copy link
Author

sanjaiganesh commented Aug 17, 2016

The main files that you would care are below. Rest are details.

Startup Task: AllJoyn/Platform/BridgeHostStartupTask/Program.cs
App Service: AllJoyn/Platform/BridgeHost/App.xaml.cs

Test app:
AllJoyn/Platform/TestApps/UwpTestApp/MainPage.xaml.cs #ByDesign

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
Copy link
Collaborator

@jasongin jasongin Aug 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably shouldn't force everyone to upgrade to a prerelease version of VS. Or is it needed for some reason? #Closed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required. I shall fix that


In reply to: 75173869 [](ancestors = 75173869)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it opens in VS 14 as well. So no issue as such.


In reply to: 75178273 [](ancestors = 75178273,75173869)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#Resolved


In reply to: 75179512 [](ancestors = 75179512,75178273,75173869)

@jasongin
Copy link
Collaborator

jasongin commented Aug 17, 2016

Update these flavors also? #Closed


Refers to: AllJoyn/Platform/Bridge/ScriptAdapterLib/ScriptAdapterLib.vcxproj:193 in e5c638c. [](commit_id = e5c638c, deletion_comment = False)

@jasongin
Copy link
Collaborator

jasongin commented Aug 17, 2016

  <AdditionalIncludeDirectories>..\..\..\External\boost;..\ScriptAdapterLib;..\ScriptAdapterLib\Deps\inc;..\Common;..\Bridge;$(WindowsSdkDir_10)\Include\$(TargetPlatformVersion)\um\AllJoyn;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

Fix other flavors also? #Closed


Refers to: AllJoyn/Platform/Bridge/ScriptAdapterLibUW/ScriptAdapterLibUW.vcxproj:140 in e5c638c. [](commit_id = e5c638c, deletion_comment = False)

appServiceConnection = appServiceDetails.AppServiceConnection;
appServiceConnection.RequestReceived += AppServiceConnection_RequestReceived;
appServiceConnection.ServiceClosed += AppServiceConnection_ServiceClosed;
}
Copy link
Collaborator

@jasongin jasongin Aug 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider refactoring all the app service related code into a separate class, maybe called AllJoynAppService. All the event handlers here as well as some other helper methods could be moved over. In my experience App.xaml.cs tends to get very cluttered if you don't take care to delegate responsibilities. #Closed

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall leave it like this for now and consider refactoring later.


In reply to: 75184136 [](ancestors = 75184136)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#ByDesign


In reply to: 75206780 [](ancestors = 75206780,75184136)

@jasongin
Copy link
Collaborator

🕐

@sanjaiganesh
Copy link
Author

  <AdditionalIncludeDirectories>..\..\..\External\boost;..\ScriptAdapterLib;..\ScriptAdapterLib\Deps\inc;..\Common;..\Bridge;$(WindowsSdkDir_10)\Include\$(TargetPlatformVersion)\um\AllJoyn;$(ProjectDir);$(GeneratedFilesDir);$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

#Resolved


In reply to: 240497696 [](ancestors = 240497696)


Refers to: AllJoyn/Platform/Bridge/ScriptAdapterLibUW/ScriptAdapterLibUW.vcxproj:140 in e5c638c. [](commit_id = e5c638c, deletion_comment = False)

@sanjaiganesh
Copy link
Author

#Resolved


In reply to: 240496420 [](ancestors = 240496420)


Refers to: AllJoyn/Platform/Bridge/ScriptAdapterLib/ScriptAdapterLib.vcxproj:193 in e5c638c. [](commit_id = e5c638c, deletion_comment = False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants