-
Notifications
You must be signed in to change notification settings - Fork 40
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
c-open: Fix cached status. Fix SDO 7B last packet. Add cb_notify event. #56
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 |
---|---|---|
|
@@ -223,11 +223,19 @@ typedef enum co_dtype | |
/** Access function event */ | ||
typedef enum od_event | ||
{ | ||
OD_EVENT_READ, /**< Read subindex */ | ||
OD_EVENT_WRITE, /**< Write subindex */ | ||
OD_EVENT_RESTORE, /**< Restore default value */ | ||
OD_EVENT_READ, /**< Read subindex */ | ||
OD_EVENT_WRITE, /**< Write subindex */ | ||
OD_EVENT_RESTORE, /**< Restore default value */ | ||
} od_event_t; | ||
|
||
/** Notify event */ | ||
typedef enum od_notify_event | ||
{ | ||
OD_NOTIFY_ACCESSED, | ||
OD_NOTIFY_VALUE_SET, | ||
OD_NOTIFY_SDO_RECEIVED, | ||
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 both ACCESSED and VALUE_SET required? They are both called from co_od_set_value and it seems that the only difference is whether the user has specified that the object has an accessor function or not. SDO_RECEIVED seems to be used when an object larger than 64 bits is being downloaded and will be called for every partial update with the size received so far. So the value in this case is a size. This should be documented. There should also be a test that verifies the functionality. |
||
} od_notify_event_t; | ||
|
||
struct co_obj; | ||
struct co_entry; | ||
|
||
|
@@ -317,7 +325,7 @@ typedef struct co_cfg | |
uint8_t msef[5]); | ||
|
||
/** Notify callback */ | ||
void (*cb_notify) (co_net_t * net, uint16_t index, uint8_t subindex); | ||
void (*cb_notify) (co_net_t * net, uint16_t index, uint8_t subindex, od_notify_event_t event, uint32_t value); | ||
|
||
/** Function to open dictionary store */ | ||
void * (*open) (co_store_t store, co_mode_t mode); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the default timeout for every user of c-open. Note that this is an option that can be adjusted locally if a particular application has different requirements.