Cmd

Enum Cmd 

Source
pub enum Cmd {
Show 38 variants GetIdReq { product_id: u64, product_code: [u8; 8], }, GetIdRes { device_id: Id, private_key: [u8; 8], public_key: [u8; 8], }, LoginReq { code: [u8; 8], }, LoginRes {}, HeartReq {}, HeartRes {}, GetTimestampReq {}, GetTimestampRes { timestamp: u64, }, SetActualReq { id: Id, code: [u8; 8], k: u16, v: Vec<u8>, }, SetActualRes { id: Id, k: u16, v: Vec<u8>, }, GetActualReq { id: Id, code: [u8; 8], k: u16, }, GetActualRes { id: Id, k: u16, v: Vec<u8>, }, SubActualReq { id: Id, code: [u8; 8], k: u16, }, SubActualRes { id: Id, k: u16, }, SubAllActualReq { id: Id, code: [u8; 8], }, SubAllActualRes { id: Id, }, NoticeActual { id: Id, k: u16, v: Vec<u8>, }, SetTargetReq { id: Id, code: [u8; 8], k: u16, v: Vec<u8>, }, SetTargetRes { id: Id, k: u16, v: Vec<u8>, }, GetTargetReq { id: Id, code: [u8; 8], k: u16, }, GetTargetRes { id: Id, k: u16, v: Vec<u8>, }, SubTargetReq { id: Id, code: [u8; 8], k: u16, }, SubTargetRes { id: Id, k: u16, }, SubAllTargetReq { id: Id, code: [u8; 8], }, SubAllTargetRes { id: Id, }, NoticeTarget { id: Id, k: u16, v: Vec<u8>, }, EnterBindReq { code: [u8; 4], }, EnterBindRes { code: [u8; 4], }, BindReq { product_id: u64, code: [u8; 4], }, BindRes { id: Id, public_key: [u8; 8], }, UnbindReq { id: Id, }, UnbindRes { id: Id, }, NoticeBind { id: Id, public_key: [u8; 8], }, NoticeUnbind { id: Id, }, GetOTAInfo, GetOTA, EnterOTA, Unknown { body: Vec<u8>, },
}

Variants§

§

GetIdReq

注册设备ID

Fields

§product_id: u64
§product_code: [u8; 8]
§

GetIdRes

Fields

§device_id: Id
§private_key: [u8; 8]
§public_key: [u8; 8]
§

LoginReq

设备上线

Fields

§code: [u8; 8]
§

LoginRes

§

HeartReq

心跳

§

HeartRes

§

GetTimestampReq

获取时间戳

§

GetTimestampRes

Fields

§timestamp: u64
§

SetActualReq

设置云端变量实际值

Fields

§id: Id
§code: [u8; 8]
§v: Vec<u8>
§

SetActualRes

Fields

§id: Id
§v: Vec<u8>
§

GetActualReq

读取云端变量实际值

Fields

§id: Id
§code: [u8; 8]
§

GetActualRes

Fields

§id: Id
§v: Vec<u8>
§

SubActualReq

订阅云端变量实际值变更通知

Fields

§id: Id
§code: [u8; 8]
§

SubActualRes

Fields

§id: Id
§

SubAllActualReq

订阅全部云端变量实际值变更通知

Fields

§id: Id
§code: [u8; 8]
§

SubAllActualRes

Fields

§id: Id
§

NoticeActual

发送云端变量实际值变更通知

Fields

§id: Id
§v: Vec<u8>
§

SetTargetReq

设置云端变量目标值

Fields

§id: Id
§code: [u8; 8]
§v: Vec<u8>
§

SetTargetRes

Fields

§id: Id
§v: Vec<u8>
§

GetTargetReq

读取云端变量目标值

Fields

§id: Id
§code: [u8; 8]
§

GetTargetRes

Fields

§id: Id
§v: Vec<u8>
§

SubTargetReq

订阅云端变量目标值变更通知

Fields

§id: Id
§code: [u8; 8]
§

SubTargetRes

Fields

§id: Id
§

SubAllTargetReq

订阅全部云端变量目标值变更通知

Fields

§id: Id
§code: [u8; 8]
§

SubAllTargetRes

Fields

§id: Id
§

NoticeTarget

发送云端变量目标值变更通知

Fields

§id: Id
§v: Vec<u8>
§

EnterBindReq

进入绑定模式

Fields

§code: [u8; 4]
§

EnterBindRes

Fields

§code: [u8; 4]
§

BindReq

用户绑定设备

Fields

§product_id: u64
§code: [u8; 4]
§

BindRes

Fields

§id: Id
§public_key: [u8; 8]
§

UnbindReq

用户解绑设备

Fields

§id: Id
§

UnbindRes

Fields

§id: Id
§

NoticeBind

发送设备被绑定通知

Fields

§id: Id
§public_key: [u8; 8]
§

NoticeUnbind

发送设备被解绑通知

Fields

§id: Id
§

GetOTAInfo

获取软件包信息

§

GetOTA

获取软件包分片

§

EnterOTA

进入升级模式

§

Unknown

无效指令

Fields

§body: Vec<u8>

Implementations§

Source§

impl Cmd

Source

pub fn parse(kind: Kind, status: Status, buf: &[u8]) -> Self

Source

pub fn to_buf(&self) -> Vec<u8>

Trait Implementations§

Source§

impl Clone for Cmd

Source§

fn clone(&self) -> Cmd

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Cmd

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Cmd

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Cmd

§

impl RefUnwindSafe for Cmd

§

impl Send for Cmd

§

impl Sync for Cmd

§

impl Unpin for Cmd

§

impl UnwindSafe for Cmd

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.