-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ILocationSync] Update with JSON-RPC interface #407
base: master
Are you sure you want to change the base?
Changes from 11 commits
63ecc3b
96c6fb7
45fea21
5bd3500
479b315
1710768
dc03c01
0fdf1f5
ad4477d
43a3a65
cdd8b73
5c44bbc
7fe448c
0b1c059
919eab1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* If not stated otherwise in this file or this component's LICENSE file the | ||
* following copyright and licenses apply: | ||
* | ||
* Copyright 2021 Metrological | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "Module.h" | ||
|
||
namespace Thunder { | ||
|
||
namespace Exchange { | ||
|
||
// @json 1.0.0 @uncompliant:collapsed @text:legacy_lowercase | ||
struct EXTERNAL ILocationSync : virtual public Core::IUnknown { | ||
|
||
enum { ID = ID_LOCATIONSYNC }; | ||
|
||
struct locationinfo { | ||
string city /* @brief City name (e.g. Wroclaw) */; | ||
string country /* @brief Country name (e.g. Poland) */; | ||
string region /* @brief Region name (e.g. Silesia) */; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think, depending on the service we are calling, not all services will or can return a value for these settings. I think the once I always saw where city/country and publicIP. So to indicate such a "missing" piece of information I would prefer to have her at least around (region/timezone, maybe city and or country as well) the Core::OptionalType<> So that you know that t is available or not. I guess empty strings might lead to assumptions :-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Personally I think the public_ip is the "only" mandatory, always available field ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed each field to |
||
string timeZone /* @brief Time zone information (e.g. CET-1CEST,M3.5.0,M10.5.0/3) */; | ||
string publicIP /* @brief Public IP (e.g. 78.11.117.118) */; | ||
}; | ||
|
||
// @event | ||
struct EXTERNAL INotification : virtual public Core::IUnknown { | ||
|
||
enum { ID = ID_LOCATIONSYNC_NOTIFICATION }; | ||
|
||
// @brief Signals a location change | ||
virtual void LocationChange() = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm interesting wording :-) Is it a LocationChange (we Moved??) or a LocationUpdate, we have different information.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is attempting to keep backward compatibility, but indeed we do have (a)alt tag to correct this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed it to Updated() like we discussed on Skype, and added |
||
}; | ||
|
||
virtual Core::hresult Register(INotification* const notification) = 0; | ||
virtual Core::hresult Unregister(const INotification* const notification) = 0; | ||
|
||
// @brief Synchronize the location | ||
// @retval ERROR_GENERAL Failed to synchdonize the location | ||
// @retval ERROR_UNAVAILABLE Locator is not available | ||
// @retval ERROR_INCORRECT_URL The URL is incorrect | ||
// @retval ERROR_INPROGRESS Probing is still in progress | ||
virtual Core::hresult Sync() = 0; | ||
|
||
// @property | ||
// @brief Get information about the location | ||
// @retval ERROR_UNAVAILABLE Either the internet or the location information is not available | ||
virtual Core::hresult Location(locationinfo& info /* @out */) const = 0; | ||
|
||
}; | ||
|
||
} // namespace Exchange | ||
|
||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove uncompliant as there are no methods/properties with input parameters.