Skip to content
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

Add base RPCs and supporting classes #24

Merged
merged 30 commits into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
13790e2
Add RAI and supporting classes
joeygrover Nov 8, 2019
7f32e4c
Fix jsdoc
joeygrover Nov 13, 2019
5a6452c
Add RAI Response and supporting RPCs
joeygrover Nov 13, 2019
767cd07
Merge branch 'develop' of https://github.com/smartdevicelink/sdl_java…
joeygrover Nov 13, 2019
4e83fb8
Update enums static members
joeygrover Nov 13, 2019
ffa6e98
Update static members for messages
joeygrover Nov 13, 2019
5f488e5
Update static members in structs
joeygrover Nov 13, 2019
73d944f
Add jsDoc back to FunctionId
joeygrover Nov 13, 2019
22be335
Add Show and response
joeygrover Nov 13, 2019
d258b2d
Fix messages static member access
joeygrover Nov 13, 2019
e9c066e
Fix struct static member access
joeygrover Nov 13, 2019
75d8451
Finish TextField
joeygrover Nov 13, 2019
1561b03
Merge branch 'develop' of https://github.com/smartdevicelink/sdl_java…
joeygrover Nov 13, 2019
ef57894
Move added RPCs to new structure
joeygrover Nov 13, 2019
e22461d
Fix AddCommand jsdoc
joeygrover Nov 14, 2019
feb4ce8
Add PutFile
joeygrover Nov 14, 2019
f3eca31
Fix incorrect set for bulkData
joeygrover Nov 14, 2019
93f8d52
Add fileData setter in putFile
joeygrover Nov 14, 2019
92234ef
Add SetAppIcon
joeygrover Nov 14, 2019
db70750
Add OnHMIStatus
joeygrover Nov 14, 2019
a73a0f9
Update displayType
joeygrover Nov 20, 2019
9a98515
Update enums to reflect internal_name
joeygrover Nov 20, 2019
b5e4b86
Apply suggestions from code review
joeygrover Nov 20, 2019
cf1220a
Update lib/js/src/rpc/messages/RegisterAppInterface.js
joeygrover Nov 20, 2019
0603f45
Update lib/js/src/rpc/messages/RegisterAppInterfaceResponse.js
joeygrover Nov 20, 2019
1c1a09b
Add validateType for TODOs
joeygrover Nov 20, 2019
0b421fc
Remove rpc spec xml
joeygrover Nov 20, 2019
ef5af44
Make MAP member private
joeygrover Nov 20, 2019
aad9c45
Enums updated functions to match name
joeygrover Nov 21, 2019
65ceefb
Apply suggestions from code review 2
joeygrover Nov 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions lib/js/src/protocol/enums/FrameType.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Enum } from '../../util/Enum.js';

/**
* @typedef {Enum} FrameType
* @property {Object} MAP
* @property {Object} _MAP
*/
class FrameType extends Enum {

Expand All @@ -49,28 +49,28 @@ class FrameType extends Enum {
* @return {Number}
*/
static get CONTROL() {
return FrameType.MAP.CONTROL;
return FrameType._MAP.CONTROL;
}

/**
* @return {Number}
*/
static get FIRST() {
return FrameType.MAP.FIRST;
return FrameType._MAP.FIRST;
}

/**
* @return {Number}
*/
static get CONSECUTIVE() {
return FrameType.MAP.CONSECUTIVE;
return FrameType._MAP.CONSECUTIVE;
}

/**
* @return {Number}
*/
static get SINGLE() {
return FrameType.MAP.SINGLE;
return FrameType._MAP.SINGLE;
}

/**
Expand All @@ -79,21 +79,21 @@ class FrameType extends Enum {
* @return {null|Number} - Returns null if the enum value doesn't exist
*/
static valueForString(value) {
for (let key in FrameType.MAP) {
if (FrameType.MAP[key] === value) {
return FrameType.MAP[key];
for (let key in FrameType._MAP) {
if (FrameType._MAP[key] === value) {
return FrameType._MAP[key];
}
}

return null;
}
}

FrameType.MAP = Object.freeze({
'CONTROL': 0x00,
'FIRST': 0x02,
'CONSECUTIVE': 0x03,
'SINGLE': 0x01,
FrameType._MAP = Object.freeze({
'CONTROL': 0x00,
'FIRST': 0x02,
'CONSECUTIVE': 0x03,
'SINGLE': 0x01,
});

export { FrameType };
20 changes: 10 additions & 10 deletions lib/js/src/protocol/enums/ServiceType.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Enum } from '../../util/Enum.js';

/**
* @typedef {Enum} ServiceType
* @property {Object} MAP
* @property {Object} _MAP
*/
class ServiceType extends Enum {

Expand All @@ -49,53 +49,53 @@ class ServiceType extends Enum {
* @return {Number}
*/
static get CONTROL() {
return ServiceType.MAP.CONTROL;
return ServiceType._MAP.CONTROL;
}

/**
* @return {Number}
*/
static get RPC() {
return ServiceType.MAP.RPC;
return ServiceType._MAP.RPC;
}

/**
* @return {Number}
*/
static get AUDIO() {
return ServiceType.MAP.AUDIO;
return ServiceType._MAP.AUDIO;
}

/**
* @return {Number}
*/
static get VIDEO() {
return ServiceType.MAP.VIDEO;
return ServiceType._MAP.VIDEO;
}

/**
* @return {Number}
*/
static get HYBRID() {
return ServiceType.MAP.HYBRID;
return ServiceType._MAP.HYBRID;
}

/**
* Confirms whether the value passed in exists in the Enums of this class
* @return {null|Number} - Returns null if the enum value doesn't exist
*/
static valueForString(value) {
for (let key in ServiceType.MAP) {
if (ServiceType.MAP[key] === value) {
return ServiceType.MAP[key];
for (let key in ServiceType._MAP) {
if (ServiceType._MAP[key] === value) {
return ServiceType._MAP[key];
}
}

return null;
}
}

ServiceType.MAP = Object.freeze({
ServiceType._MAP = Object.freeze({
'CONTROL': 0x00,
'RPC': 0x07,
'AUDIO': 0x0A,
Expand Down
2 changes: 1 addition & 1 deletion lib/js/src/rpc/RpcMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class RpcMessage extends RpcStruct {
this._rpcType = store.rpcType;
this._functionName = store.functionName;
this._correlationID = store.correlationID;
this._bulkData = this.setBulkData(store.bulkData);
this.setBulkData(store.bulkData);
}

/**
Expand Down
154 changes: 154 additions & 0 deletions lib/js/src/rpc/enums/AppHMIType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/*
* Copyright (c) 2019, Livio, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the Livio Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

import { Enum } from '../../util/Enum.js';

/**
* @typedef {Enum} AppHMIType
* @property {Object} _MAP
*/
class AppHMIType extends Enum {

constructor() {
super();
}

/**
* @return {String}
*/
static get DEFAULT() {
return AppHMIType._MAP.DEFAULT;
}

/**
* @return {String}
*/
static get COMMUNICATION() {
return AppHMIType._MAP.COMMUNICATION;
}

/**
* @return {String}
*/
static get MEDIA() {
return AppHMIType._MAP.MEDIA;
}

/**
* @return {String}
*/
static get MESSAGING() {
return AppHMIType._MAP.MESSAGING;
}

/**
* @return {String}
*/
static get NAVIGATION() {
return AppHMIType._MAP.NAVIGATION;
}

/**
* @return {String}
*/
static get INFORMATION() {
return AppHMIType._MAP.INFORMATION;
}

/**
* @return {String}
*/
static get SOCIAL() {
return AppHMIType._MAP.SOCIAL;
}

/**
* @return {String}
*/
static get BACKGROUND_PROCESS() {
return AppHMIType._MAP.BACKGROUND_PROCESS;
}

/**
* @return {String}
*/
static get TESTING() {
return AppHMIType._MAP.TESTING;
}

/**
* @return {String}
*/
static get SYSTEM() {
return AppHMIType._MAP.SYSTEM;
}

/**
* @return {String}
*/
static get PROJECTION() {
return AppHMIType._MAP.PROJECTION;
}

/**
* @return {String}
*/
static get REMOTE_CONTROL() {
return AppHMIType._MAP.REMOTE_CONTROL;
}

/**
* Confirms whether the value passed in exists in the Enums of this class
* @param {String} value
* @return {null|String} - Returns null if the enum value doesn't exist
*/
static valueForString(value) {
return AppHMIType.valueForStringInternal(value, AppHMIType._MAP);
}
}

AppHMIType._MAP = Object.freeze({
'DEFAULT': 'DEFAULT',
'COMMUNICATION': 'COMMUNICATION',
'MEDIA': 'MEDIA',
'MESSAGING': 'MESSAGING',
'NAVIGATION': 'NAVIGATION',
'INFORMATION': 'INFORMATION',
'SOCIAL': 'SOCIAL',
'BACKGROUND_PROCESS': 'BACKGROUND_PROCESS',
'TESTING': 'TESTING',
'SYSTEM': 'SYSTEM',
'PROJECTION': 'PROJECTION',
'REMOTE_CONTROL': 'REMOTE_CONTROL',
});

export { AppHMIType };
83 changes: 83 additions & 0 deletions lib/js/src/rpc/enums/AudioStreamingState.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright (c) 2019, Livio, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the Livio Inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

import { Enum } from '../../util/Enum.js';

/**
* @typedef {Enum} AudioStreamingState
* @property {Object} _MAP
*/
class AudioStreamingState extends Enum {

constructor() {
super();
}

/**
* @return {String}
*/
static get AUDIBLE() {
return AudioStreamingState._MAP.AUDIBLE;
}

/**
* @return {String}
*/
static get ATTENUATED() {
return AudioStreamingState._MAP.ATTENUATED;
}

/**
* @return {String}
*/
static get NOT_AUDIBLE() {
return AudioStreamingState._MAP.NOT_AUDIBLE;
}

/**
* Confirms whether the value passed in exists in the Enums of this class
* @param {String} value
* @return {null|String} - Returns null if the enum value doesn't exist
*/
static valueForString(value) {
return AudioStreamingState.valueForStringInternal(value, AudioStreamingState._MAP);
}
}

AudioStreamingState._MAP = Object.freeze({
'AUDIBLE': 'AUDIBLE',
'ATTENUATED': 'ATTENUATED',
'NOT_AUDIBLE': 'NOT_AUDIBLE',

});

export { AudioStreamingState };
Loading