using namespace OC;
// Set of strings for each of platform Info fields
-std::string platformID = "0A3E0D6F-DBF5-404E-8719-D6880042463A";
-std::string manufacturerName = "myName";
-std::string manufacturerLink = "https://www.example.com";
-std::string modelNumber = "myModelNumber";
-std::string dateOfManufacture = "2016-01-15";
-std::string platformVersion = "platformVersion";
-std::string operatingSystemVersion = "myOS";
-std::string hardwareVersion = "myHardwareVersion";
-std::string firmwareVersion = "1.0";
-std::string supportLink = "https://www.examplesupport.com";
-std::string systemTime = "2016-01-15T11.01";
+std::string gPlatformID = "0A3E0D6F-DBF5-404E-8719-D6880042463A";
+std::string gManufacturerName = "myName";
+std::string gManufacturerLink = "https://www.example.com";
+std::string gModelNumber = "myModelNumber";
+std::string gDateOfManufacture = "2016-01-15";
+std::string gPlatformVersion = "platformVersion";
+std::string gOperatingSystemVersion = "myOS";
+std::string gHardwareVersion = "myHardwareVersion";
+std::string gFirmwareVersion = "1.0";
+std::string gSupportLink = "https://www.examplesupport.com";
+std::string gSystemTime = "2016-01-15T11.01";
// Set of strings for each of device info fields
std::string deviceName = "Bill's Battlestar";
std::cout<<"Starting server & setting platform info\n";
- OCStackResult result = SetPlatformInfo(platformID, manufacturerName, manufacturerLink,
- modelNumber, dateOfManufacture, platformVersion, operatingSystemVersion,
- hardwareVersion, firmwareVersion, supportLink, systemTime);
+ OCStackResult result = SetPlatformInfo(gPlatformID, gManufacturerName, gManufacturerLink,
+ gModelNumber, gDateOfManufacture, gPlatformVersion, gOperatingSystemVersion,
+ gHardwareVersion, gFirmwareVersion, gSupportLink, gSystemTime);
result = OCPlatform::registerPlatformInfo(platformInfo);
void * handleSlowResponse (void *param, std::shared_ptr<OCResourceRequest> pRequest);
// Set of strings for each of platform Info fields
-std::string platformId = "0A3E0D6F-DBF5-404E-8719-D6880042463A";
-std::string manufacturerName = "OCF";
-std::string manufacturerLink = "https://www.iotivity.org";
-std::string modelNumber = "myModelNumber";
-std::string dateOfManufacture = "2016-01-15";
-std::string platformVersion = "myPlatformVersion";
-std::string operatingSystemVersion = "myOS";
-std::string hardwareVersion = "myHardwareVersion";
-std::string firmwareVersion = "1.0";
-std::string supportLink = "https://www.iotivity.org";
-std::string systemTime = "2016-01-15T11.01";
+std::string gPlatformId = "0A3E0D6F-DBF5-404E-8719-D6880042463A";
+std::string gManufacturerName = "OCF";
+std::string gManufacturerLink = "https://www.iotivity.org";
+std::string gModelNumber = "myModelNumber";
+std::string gDateOfManufacture = "2016-01-15";
+std::string gPlatformVersion = "myPlatformVersion";
+std::string gOperatingSystemVersion = "myOS";
+std::string gHardwareVersion = "myHardwareVersion";
+std::string gFirmwareVersion = "1.0";
+std::string gSupportLink = "https://www.iotivity.org";
+std::string gSystemTime = "2016-01-15T11.01";
// Set of strings for each of device info fields
std::string deviceName = "IoTivity Simple Server";
OC_VERIFY(OCPlatform::start() == OC_STACK_OK);
std::cout << "Starting server & setting platform info\n";
- OCStackResult result = SetPlatformInfo(platformId, manufacturerName, manufacturerLink,
- modelNumber, dateOfManufacture, platformVersion, operatingSystemVersion,
- hardwareVersion, firmwareVersion, supportLink, systemTime);
+ OCStackResult result = SetPlatformInfo(gPlatformId, gManufacturerName, gManufacturerLink,
+ gModelNumber, gDateOfManufacture, gPlatformVersion, gOperatingSystemVersion,
+ gHardwareVersion, gFirmwareVersion, gSupportLink, gSystemTime);
result = OCPlatform::registerPlatformInfo(platformInfo);
void * ChangeLightRepresentation (void *param);
// Set of strings for each of platform Info fields
-std::string platformId = "0A3E0D6F-DBF5-404E-8719-D6880042463A";
-std::string manufacturerName = "OCF";
-std::string manufacturerLink = "https://www.iotivity.org";
-std::string modelNumber = "myModelNumber";
-std::string dateOfManufacture = "2016-01-15";
-std::string platformVersion = "myPlatformVersion";
-std::string operatingSystemVersion = "myOS";
-std::string hardwareVersion = "myHardwareVersion";
-std::string firmwareVersion = "1.0";
-std::string supportLink = "https://www.iotivity.org";
-std::string systemTime = "2016-01-15T11.01";
+std::string gPlatformId = "0A3E0D6F-DBF5-404E-8719-D6880042463A";
+std::string gManufacturerName = "OCF";
+std::string gManufacturerLink = "https://www.iotivity.org";
+std::string gModelNumber = "myModelNumber";
+std::string gDateOfManufacture = "2016-01-15";
+std::string gPlatformVersion = "myPlatformVersion";
+std::string gOperatingSystemVersion = "myOS";
+std::string gHardwareVersion = "myHardwareVersion";
+std::string gFirmwareVersion = "1.0";
+std::string gSupportLink = "https://www.iotivity.org";
+std::string gSystemTime = "2016-01-15T11.01";
// Set of strings for each of device info fields
std::string deviceName = "IoTivity Simple Server HQ";
OCPlatform::Configure(cfg);
std::cout << "Starting server & setting platform info\n";
- OCStackResult result = SetPlatformInfo(platformId, manufacturerName, manufacturerLink,
- modelNumber, dateOfManufacture, platformVersion, operatingSystemVersion,
- hardwareVersion, firmwareVersion, supportLink, systemTime);
+ OCStackResult result = SetPlatformInfo(gPlatformId, gManufacturerName, gManufacturerLink,
+ gModelNumber, gDateOfManufacture, gPlatformVersion, gOperatingSystemVersion,
+ gHardwareVersion, gFirmwareVersion, gSupportLink, gSystemTime);
result = OCPlatform::registerPlatformInfo(platformInfo);
#include <functional>\r
\r
extern int g_CurSliderVal;\r
-extern HWND hwndVolumeSlider, hwndVolumeExpectedLabel;\r
+extern HWND g_hwndVolumeSlider, g_hwndVolumeExpectedLabel;\r
using namespace WinUIClient;\r
void LabelPrintf (HWND hwndEdit, TCHAR * szFormat, ...);\r
\r
std::cout << "\tname: " << mymedia.m_name << std::endl;\r
\r
g_CurSliderVal = mymedia.m_volume;\r
- SendMessage(hwndVolumeSlider, TBM_SETPOS, TRUE, g_CurSliderVal);\r
- LabelPrintf(hwndVolumeExpectedLabel,"Volume: %i", g_CurSliderVal);\r
+ SendMessage(g_hwndVolumeSlider, TBM_SETPOS, TRUE, g_CurSliderVal);\r
+ LabelPrintf(g_hwndVolumeExpectedLabel,"Volume: %i", g_CurSliderVal);\r
\r
}\r
else\r
std::cout << "\tname: " << mymedia.m_name << std::endl;\r
\r
g_CurSliderVal = mymedia.m_volume;\r
- SendMessage(hwndVolumeSlider, TBM_SETPOS, TRUE, g_CurSliderVal);\r
- LabelPrintf(hwndVolumeExpectedLabel,"Volume: %i", g_CurSliderVal);\r
+ SendMessage(g_hwndVolumeSlider, TBM_SETPOS, TRUE, g_CurSliderVal);\r
+ LabelPrintf(g_hwndVolumeExpectedLabel,"Volume: %i", g_CurSliderVal);\r
}\r
else\r
{\r
void WinUIClientApp::CancelObserving()\r
{\r
std::cout<<"Cancelling Observe..."<<std::endl;\r
- OCStackResult result = curResource->cancelObserve();\r
+ curResource->cancelObserve();\r
}\r
\r
std::shared_ptr<OCResource> WinUIClientApp::GetResource()\r
int g_CurSliderVal = 0;
-HWND hwnd, icon_button, hwndVolumeSlider, hwndVolumeExpectedLabel;
+HWND g_hwnd, g_icon_button, g_hwndVolumeSlider, g_hwndVolumeExpectedLabel;
HWND hwndButtonPlayPause, hwndButtonFind, hwndButtonGet, hwndButtonPut, hwndButtonPost, hwndButtonBeginObserve, hwndButtonCancelObserve;
-HINSTANCE hInstance, g_hinstTrackBar, g_hinstVolumeSlider, g_hinstVolumeLabel;
HANDLE Timer, Thread;
HICON hIcon1;
HBRUSH g_BkgndBrush;
}
}
-int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPSTR lpCmdLine, int nCmdShow )
+int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ LPSTR /* lpCmdLine */, int nCmdShow )
{
MSG msg;
WNDCLASS wc = {sizeof(WNDCLASS)};
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
RegisterClass(&wc);
- hwnd = CreateWindow( wc.lpszClassName, TEXT("IoTivity Media Client - Windows UI"),
+ g_hwnd = CreateWindow( wc.lpszClassName, TEXT("IoTivity Media Client - Windows UI"),
WS_OVERLAPPEDWINDOW ^ WS_THICKFRAME,
100, 100, 275, 170, 0, 0, hInstance, 0);
InitCommonControls(); // loads common control's DLL
- hwndVolumeSlider =
- CreateTrackbar(hwnd,
+ g_hwndVolumeSlider =
+ CreateTrackbar(g_hwnd,
10,10,
170,40,
0,100,
0,0);
- hwndVolumeExpectedLabel =
- CreateLabel(hwnd,
+ g_hwndVolumeExpectedLabel =
+ CreateLabel(g_hwnd,
"Expected Volume",
10,50,
240,30);
- LabelPrintf(hwndVolumeExpectedLabel,
+ LabelPrintf(g_hwndVolumeExpectedLabel,
"Expected Volume: %i",
0);
hwndButtonPlayPause =
- CreateButton(hwnd,
+ CreateButton(g_hwnd,
ID_BUTTONPLAYPAUSE,
"PlayPause",
180,10,
80,35);
hwndButtonFind =
- CreateButton(hwnd,
+ CreateButton(g_hwnd,
ID_BUTTONFIND,
"Find",
10,75,
64,25);
hwndButtonGet =
- CreateButton(hwnd,
+ CreateButton(g_hwnd,
ID_BUTTONGET,
"Get",
10,105,
64,25);
hwndButtonPut =
- CreateButton(hwnd,
+ CreateButton(g_hwnd,
ID_BUTTONPUT,
"Put",
80,75,
64,25);
hwndButtonPost =
- CreateButton(hwnd,
+ CreateButton(g_hwnd,
ID_BUTTONPOST,
"Post",
80,105,
64,25);
hwndButtonBeginObserve =
- CreateButton(hwnd,
+ CreateButton(g_hwnd,
ID_BUTTONBEGINOBSERVE,
"Bgn Obs",
150,75,
64,25);
hwndButtonCancelObserve =
- CreateButton(hwnd,
+ CreateButton(g_hwnd,
ID_BUTTONCANCELOBSERVE,
"Cncl Obs",
150,105,
64,25);
- ShowWindow(hwnd, nCmdShow);
- UpdateWindow(hwnd);
+ ShowWindow(g_hwnd, nCmdShow);
+ UpdateWindow(g_hwnd);
while (GetMessage(&msg, NULL, 0, 0))
{
case WM_HSCROLL:
switch (LOWORD(wParam)) {
case TB_ENDTRACK:
- g_CurSliderVal = (int)SendMessage(hwndVolumeSlider, TBM_GETPOS, 0, 0);
- LabelPrintf(hwndVolumeExpectedLabel,"Volume: %i", g_CurSliderVal);
+ g_CurSliderVal = (int)SendMessage(g_hwndVolumeSlider, TBM_GETPOS, 0, 0);
+ LabelPrintf(g_hwndVolumeExpectedLabel,"Volume: %i", g_CurSliderVal);
myMedia = app->GetMedia();
myMedia.m_volume = g_CurSliderVal;
case WM_CREATE:
{
hIcon1 = LoadIcon (NULL, IDI_WARNING);
- SendMessage(icon_button,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcon1);
+ SendMessage(g_icon_button,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcon1);
GetClientRect(hwnd, &rect);
g_BkgndBrush = GetSysColorBrush(COLOR_MENU);