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

Passthru with mock #423

Open
wants to merge 88 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
de7a738
chore: added extn folder
adamdama Aug 22, 2023
2d25e31
feat: added mockdevice contract
adamdama Aug 23, 2023
327599b
chore: renamed extn dir
adamdama Aug 23, 2023
817d22c
chore: added start of ffi
adamdama Aug 24, 2023
0dbf63c
chore: renamed contract
adamdama Aug 24, 2023
90910fc
tools: fix incorrect paths in setup script
adamdama Aug 24, 2023
c3c35c8
chore: mock_device extn loading
adamdama Aug 24, 2023
f54b63a
chore: added mock ws server
adamdama Aug 24, 2023
239db10
wip: mock server start
adamdama Aug 24, 2023
ddf0b37
feat: mock ws server listening for connections
adamdama Aug 24, 2023
5837db5
chore: added ability to modify mock_data at run time
adamdama Aug 24, 2023
2f1065a
Merge branch 'main' into mock-device
adamdama Sep 11, 2023
c145f59
feat: ripple boots from mock device extn
adamdama Sep 12, 2023
a9ef112
fix: added missing event payload to mock data
adamdama Sep 12, 2023
276ce1d
chore: cleared warnings
adamdama Sep 15, 2023
a4b8910
chore: mock web socket server stands up with shared state in extn
adamdama Sep 15, 2023
99dbc5f
feat: added rpc interface for mock device extn
adamdama Sep 18, 2023
0410b79
feat: mock device addRequestResponse working
adamdama Sep 19, 2023
9e92f67
feat: mock data can be removed from mock device
adamdama Sep 19, 2023
78de836
chore: removed Arc around mock_data mutex
adamdama Sep 19, 2023
a94c5af
Merge remote-tracking branch 'origin/main' into mock-device
adamdama Sep 19, 2023
27dded7
feat: added method to emit events
adamdama Sep 20, 2023
8b00eea
chore: mock_websocket_server from firebolt
adamdama Sep 20, 2023
359bf5b
chore: removed debug logs
adamdama Sep 20, 2023
540e033
refactor: added more flexible api surface
adamdama Sep 20, 2023
7b47724
chore: self-review todying
adamdama Sep 20, 2023
fec9d15
chore: fix manifest examples
adamdama Sep 20, 2023
c80adcd
refactor: better error handling and messages.
adamdama Sep 20, 2023
1ebc1ad
feat: mock server responding accross connections. dynamic jsonrpc id
adamdama Oct 4, 2023
fb797f5
refactor: added payload types so that we can explicitly support json-rpc
adamdama Oct 6, 2023
82b5beb
Merge remote-tracking branch 'origin/main' into mock-device
adamdama Oct 6, 2023
139ea9b
refactor: simplified names
adamdama Oct 6, 2023
dfc7660
chore: fixed clippy error
adamdama Oct 6, 2023
de65a36
chore: licenses
adamdama Oct 6, 2023
a7315fa
Merge branch 'main' into mock-device
adamdama Oct 9, 2023
3d1fd63
Merge branch 'main' into mock-device
adamdama Oct 9, 2023
6c9f4bc
test: unit tests for mock_data module
adamdama Oct 10, 2023
5de1289
refactor: removed message type in favour of payload type
adamdama Oct 11, 2023
1773a16
test: added mock websocket server tests
adamdama Oct 12, 2023
1ab77f5
chore: removed unneeded test
adamdama Oct 12, 2023
b1b5770
chore: added files for docs
adamdama Oct 12, 2023
6f444e3
refactor: use rpc_error util
adamdama Oct 13, 2023
c28f287
feat: mock data file location is now configurable
adamdama Oct 13, 2023
382fb38
refactor: fixed issue with contracts
adamdama Oct 13, 2023
33e9404
refactor: clean up errors. tried to add ffi test
adamdama Oct 16, 2023
8bd38e0
test: tried adding tests to mock device controller
adamdama Oct 16, 2023
02542a1
test: added placeholder test for processor
adamdama Oct 16, 2023
dca04ad
docs: added usage docs
adamdama Oct 16, 2023
bec114d
Merge branch 'main' into mock-device
adamdama Oct 16, 2023
465ddd6
chore: copyright notice
adamdama Oct 16, 2023
4df9a47
chore: missing copyright noticer
adamdama Oct 16, 2023
1a29df9
refactor: boot server panic message
adamdama Oct 16, 2023
179df32
merge: from main
satlead Nov 6, 2023
9fc9719
feat: Self contained extension provider (#301)
satlead Nov 7, 2023
3c8c723
chore: tidied use statements
adamdama Nov 8, 2023
9747bdc
test: fixed test for contract name change
adamdama Nov 8, 2023
208d47b
docs: updated mock device examples
adamdama Nov 8, 2023
8d19549
Merge branch 'main' into mock-device
adamdama Nov 9, 2023
b567f42
Merge branch 'main' into mock-device
adamdama Nov 13, 2023
78e2865
Add ADR for passthrough rpc
kpears201 Dec 11, 2023
b78a95b
Merge branch 'passthrough-rpc' of https://github.com/rdkcentral/Rippl…
satlead Jan 13, 2024
56efd6f
Merge branch 'main' of https://github.com/rdkcentral/Ripple into pass…
satlead Jan 29, 2024
03dc44c
feat: Communication Broker
satlead Jan 29, 2024
2c6ff7e
fix: atomicity and gateway
satlead Jan 30, 2024
0ded01e
fix: Http Broker
satlead Jan 31, 2024
da0e346
Merge branch 'main' of github.com:rdkcentral/Ripple into mock-device
satlead Jan 31, 2024
cb79e33
Merge branch 'passthru-impl' into passthru_with_mock
satlead Jan 31, 2024
4a333dd
fix: build errors
satlead Jan 31, 2024
61b610e
fix: clippy
satlead Jan 31, 2024
73662fb
feat: Working one
satlead Jan 31, 2024
754dc11
fix: Http broker
satlead Jan 31, 2024
1266109
fix: errors
satlead Feb 1, 2024
ecf6383
fix: PR Ready
satlead Feb 1, 2024
cb4d38d
fix: changes to the open rpc to remove user interest
satlead Feb 7, 2024
d0a1efe
fix: for making mock device rpc work
satlead Feb 7, 2024
82e6b57
fix: cleanup Mock data hash
satlead Feb 9, 2024
f11bf55
fix: Adding delay
satlead Feb 9, 2024
1395bc8
fix: Eventing mechanism
satlead Feb 14, 2024
ffbe320
Merge branch 'main' of github.com:rdkcentral/Ripple into passthru_wit…
satlead Feb 14, 2024
a1ee3fb
fix: Changes for eventing
satlead Feb 15, 2024
cd8e3bb
Merge branch 'main' of github.com:rdkcentral/Ripple into passthru_wit…
satlead Feb 16, 2024
7e9bb44
fix: cleanup pass through from mock
satlead Feb 16, 2024
738ba5f
fix: cleanup dependencies
satlead Feb 16, 2024
08bdab5
Merge branch 'main' of github.com:rdkcentral/Ripple into mock-device
satlead Feb 26, 2024
67c5287
fix: Dependecies
satlead Feb 26, 2024
8d19ac5
fix: Update unit tests
satlead Feb 27, 2024
8e82bca
Merge branch 'main' of github.com:rdkcentral/Ripple into mock-device
satlead Mar 4, 2024
46ba53a
Merge branch 'main' of github.com:rdkcentral/Ripple into mock-device
satlead Mar 5, 2024
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
Prev Previous commit
Next Next commit
chore: tidied use statements
adamdama committed Nov 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 3c8c7230a98774bd6d7addfe2c4cfefed1a1cabb
6 changes: 4 additions & 2 deletions device/mock_device/src/mock_data.rs
Original file line number Diff line number Diff line change
@@ -15,13 +15,15 @@
// SPDX-License-Identifier: Apache-2.0
//

use crate::mock_server::{MessagePayload, PayloadType, PayloadTypeError};
use ripple_sdk::log::error;
use serde_hashkey::{to_key_with_ordered_float, Key, OrderedFloatPolicy};
use serde_json::Value;
use std::{collections::HashMap, fmt::Display};

use crate::errors::{LoadMockDataError, MockDeviceError};
use crate::{
errors::{LoadMockDataError, MockDeviceError},
mock_server::{MessagePayload, PayloadType, PayloadTypeError},
};

pub type MockDataKey = Key<OrderedFloatPolicy>;
pub type MockData = HashMap<MockDataKey, (MockDataMessage, Vec<MockDataMessage>)>;
19 changes: 8 additions & 11 deletions device/mock_device/src/mock_device_processor.rs
Original file line number Diff line number Diff line change
@@ -14,10 +14,6 @@
//
// SPDX-License-Identifier: Apache-2.0
//
use crate::mock_server::{
AddRequestResponseResponse, EmitEventResponse, MockServerRequest, MockServerResponse,
RemoveRequestResponse,
};
use ripple_sdk::{
async_trait::async_trait,
extn::{
@@ -33,11 +29,17 @@ use ripple_sdk::{
framework::ripple_contract::RippleContract,
log::{debug, error},
tokio::sync::mpsc::{Receiver, Sender},
utils::error::RippleError,
};
use std::sync::Arc;

use crate::{
mock_data::MockDataMessage, mock_device_ffi::EXTN_NAME,
mock_data::MockDataMessage,
mock_device_ffi::EXTN_NAME,
mock_server::{
AddRequestResponseResponse, EmitEventResponse, MockServerRequest, MockServerResponse,
RemoveRequestResponse,
},
mock_web_socket_server::MockWebSocketServer,
};

@@ -192,12 +194,7 @@ impl ExtnRequestProcessor for MockDeviceProcessor {
}
}
} else {
Self::handle_error(
state.client,
extn_request,
ripple_sdk::utils::error::RippleError::ProcessorError,
)
.await
Self::handle_error(state.client, extn_request, RippleError::ProcessorError).await
}
}
}