Lely core libraries
2.2.5
|
This is the internal header file of the NMT heartbeat consumer declarations. More...
Go to the source code of this file.
Typedefs | |
typedef struct __co_nmt_hb | co_nmt_hb_t |
An opaque CANopen NMT heartbeat consumer type. | |
Functions | |
void | co_nmt_hb_ind (co_nmt_t *nmt, co_unsigned8_t id, int state, int reason, co_unsigned8_t st) |
The CANopen NMT heartbeat indication function, invoked when a heartbeat event occurs. More... | |
co_nmt_hb_t * | co_nmt_hb_create (can_net_t *net, co_nmt_t *nmt) |
Creates a new CANopen NMT heartbeat consumer service. More... | |
void | co_nmt_hb_destroy (co_nmt_hb_t *hb) |
Destroys a CANopen NMT heartbeat consumer service. More... | |
void | co_nmt_hb_set_1016 (co_nmt_hb_t *hb, co_unsigned8_t id, co_unsigned16_t ms) |
Processes the value of CANopen object 1016 (Consumer heartbeat time) for the specified heartbeat consumer. More... | |
void | co_nmt_hb_set_st (co_nmt_hb_t *hb, co_unsigned8_t st) |
Sets the expected state of a remote NMT node. More... | |
This is the internal header file of the NMT heartbeat consumer declarations.
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.
Definition in file nmt_hb.h.
void co_nmt_hb_ind | ( | co_nmt_t * | nmt, |
co_unsigned8_t | id, | ||
int | state, | ||
int | reason, | ||
co_unsigned8_t | st | ||
) |
The CANopen NMT heartbeat indication function, invoked when a heartbeat event occurs.
nmt | a pointer to an NMT master/slave service. |
id | the node-ID (in the range [1..127]). |
state | indicates whether the event occurred (CO_NMT_EC_OCCURRED) or was resolved (CO_NMT_EC_RESOLVED). Note that heartbeat state change events only occur and are never resolved. |
reason | indicates whether the event occurred because of a timeout (CO_NMT_EC_TIMEOUT) or a state change (CO_NMT_EC_STATE). |
st | the state of the node (if reason is CO_NMT_EC_STATE). |
co_nmt_hb_t* co_nmt_hb_create | ( | can_net_t * | net, |
co_nmt_t * | nmt | ||
) |
Creates a new CANopen NMT heartbeat consumer service.
net | a pointer to a CAN network. |
nmt | a pointer to an NMT master/slave service. |
void co_nmt_hb_destroy | ( | co_nmt_hb_t * | hb | ) |
Destroys a CANopen NMT heartbeat consumer service.
void co_nmt_hb_set_1016 | ( | co_nmt_hb_t * | hb, |
co_unsigned8_t | id, | ||
co_unsigned16_t | ms | ||
) |
Processes the value of CANopen object 1016 (Consumer heartbeat time) for the specified heartbeat consumer.
If the node-ID is valid and the heartbeat time is non-zero, the heartbeat consumer is activated. Note that this only activates the CAN frame receiver for heartbeat messages. The CAN timer for heartbeat events is not activated until the first heartbeat message is received or co_nmt_hb_set_st() is invoked.
hb | a pointer to a heartbeat consumer service. |
id | the node-ID. |
ms | the heartbeat time (in milliseconds). |
void co_nmt_hb_set_st | ( | co_nmt_hb_t * | hb, |
co_unsigned8_t | st | ||
) |
Sets the expected state of a remote NMT node.
If the heartbeat consumer is active, invocation of this function is equivalent to reception of a heartbeat message with the specified state and will (re)activate the CAN timer for heartbeat events.
hb | a pointer to a heartbeat consumer service. |
st | the state of the node (excluding the toggle bit). |