-
Notifications
You must be signed in to change notification settings - Fork 54
[tizen_rpc_port] Update RpcPort to support TIDL protocol version 2 #1070
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
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -157,8 +157,8 @@ class Parcel { | |
|
|
||
| static final Finalizer<rpc_port_parcel_h> _finalizer = | ||
| Finalizer<rpc_port_parcel_h>((rpc_port_parcel_h handle) { | ||
| tizen.rpc_port_parcel_destroy(handle); | ||
| }); | ||
| tizen.rpc_port_parcel_destroy(handle); | ||
| }); | ||
|
|
||
| /// Gets a byte array backed by the raw data of this parcel. | ||
| Uint8List asRaw() { | ||
|
|
@@ -484,4 +484,105 @@ class Parcel { | |
| return ParcelHeader._fromHandle(pHeader.value); | ||
| }); | ||
| } | ||
|
|
||
| /// Gets the reader position of this parcel. | ||
| int get reader { | ||
| return using((Arena arena) { | ||
| final Pointer<Uint32> pValue = arena(); | ||
| final int ret = _rpcPortParcelGetReader(_handle, pValue); | ||
| if (ret != 0) { | ||
| throw PlatformException( | ||
| code: ret.toString(), | ||
| message: tizen.get_error_message(ret).toDartString(), | ||
| ); | ||
| } | ||
| return pValue.value; | ||
| }); | ||
| } | ||
|
|
||
| /// Sets the reader position of this parcel. | ||
| set reader(int value) { | ||
| RangeError.checkNotNegative(value, 'value'); | ||
| final int ret = _rpcPortParcelSetReader(_handle, value); | ||
| if (ret != 0) { | ||
| throw PlatformException( | ||
| code: ret.toString(), | ||
| message: tizen.get_error_message(ret).toDartString(), | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| /// Gets the data size of this parcel. | ||
| int get dataSize { | ||
| return using((Arena arena) { | ||
| final Pointer<Uint32> pValue = arena(); | ||
| final int ret = _rpcPortParcelGetDataSize(_handle, pValue); | ||
| if (ret != 0) { | ||
| throw PlatformException( | ||
| code: ret.toString(), | ||
| message: tizen.get_error_message(ret).toDartString(), | ||
| ); | ||
| } | ||
| return pValue.value; | ||
| }); | ||
| } | ||
|
|
||
| /// Sets the data size of this parcel. | ||
| set dataSize(int value) { | ||
| RangeError.checkNotNegative(value, 'value'); | ||
| final int ret = _rpcPortParcelSetDataSize(_handle, value); | ||
| if (ret != 0) { | ||
| throw PlatformException( | ||
| code: ret.toString(), | ||
| message: tizen.get_error_message(ret).toDartString(), | ||
| ); | ||
| } | ||
| } | ||
|
pjh9216 marked this conversation as resolved.
|
||
|
|
||
| /// Reserves the capacity of this parcel. | ||
| void reserve(int size) { | ||
| RangeError.checkNotNegative(size, 'size'); | ||
| final int ret = _rpcPortParcelReserve(_handle, size); | ||
| if (ret != 0) { | ||
| throw PlatformException( | ||
| code: ret.toString(), | ||
| message: tizen.get_error_message(ret).toDartString(), | ||
| ); | ||
| } | ||
| } | ||
|
pjh9216 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| final DynamicLibrary _libRpcPort = DynamicLibrary.open('librpc-port.so.1'); | ||
|
Member
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. Do these APIs have a dependency on the Tizen version? Are they only used in Tizen 11?
Author
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. Yes, It is dependent on tizen version. Since Tizen 10
Member
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. Are these APIs public open ACR APIs?
Author
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. It is internal API but It will not be changed to support backward compatibility. |
||
|
|
||
| final int Function(rpc_port_parcel_h, Pointer<Uint32>) | ||
| _rpcPortParcelGetReader = _libRpcPort | ||
| .lookup<NativeFunction<Int32 Function(rpc_port_parcel_h, Pointer<Uint32>)>>( | ||
| 'rpc_port_parcel_get_reader', | ||
| ) | ||
| .asFunction(); | ||
|
|
||
| final int Function(rpc_port_parcel_h, int) _rpcPortParcelSetReader = _libRpcPort | ||
| .lookup<NativeFunction<Int32 Function(rpc_port_parcel_h, Uint32)>>( | ||
| 'rpc_port_parcel_set_reader', | ||
| ) | ||
| .asFunction(); | ||
|
|
||
| final int Function(rpc_port_parcel_h, Pointer<Uint32>) | ||
| _rpcPortParcelGetDataSize = _libRpcPort | ||
| .lookup<NativeFunction<Int32 Function(rpc_port_parcel_h, Pointer<Uint32>)>>( | ||
| 'rpc_port_parcel_get_data_size', | ||
| ) | ||
| .asFunction(); | ||
|
|
||
| final int Function(rpc_port_parcel_h, int) _rpcPortParcelSetDataSize = | ||
| _libRpcPort | ||
| .lookup<NativeFunction<Int32 Function(rpc_port_parcel_h, Uint32)>>( | ||
| 'rpc_port_parcel_set_data_size', | ||
| ) | ||
| .asFunction(); | ||
|
|
||
| final int Function(rpc_port_parcel_h, int) _rpcPortParcelReserve = _libRpcPort | ||
| .lookup<NativeFunction<Int32 Function(rpc_port_parcel_h, Uint32)>>( | ||
| 'rpc_port_parcel_reserve', | ||
| ) | ||
| .asFunction(); | ||
Uh oh!
There was an error while loading. Please reload this page.