Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
Beam Positoning Monitor - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Beam Positoning Monitor - Software
Commits
1563dbef
Commit
1563dbef
authored
Jun 16, 2015
by
Lucas Russo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/{sm_io,dev_io}/*: fix wrong error enum usage
parent
110d42da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
dev_io_core.c
src/dev_io/dev_io_core.c
+7
-7
sm_ch_pca9547.c
src/sm_io/chips/sm_ch_pca9547.c
+4
-4
sm_io.c
src/sm_io/sm_io.c
+10
-10
No files found.
src/dev_io/dev_io_core.c
View file @
1563dbef
...
...
@@ -180,9 +180,9 @@ devio_t * devio_new (char *name, uint32_t id, char *endpoint_dev,
self
->
disp_table_thsafe_ops
=
disp_table_new
(
&
devio_disp_table_ops
);
ASSERT_ALLOC
(
self
->
disp_table_thsafe_ops
,
err_disp_table_thsafe_ops_alloc
);
hutils_err_e
hutils
_err
=
disp_table_insert_all
(
self
->
disp_table_thsafe_ops
,
disp_table_err_e
disp
_err
=
disp_table_insert_all
(
self
->
disp_table_thsafe_ops
,
self
->
thsafe_server_ops
);
ASSERT_TEST
(
hutils
_err
==
HUTILS_SUCCESS
,
"Could not initialize dispatch table"
,
ASSERT_TEST
(
disp
_err
==
HUTILS_SUCCESS
,
"Could not initialize dispatch table"
,
err_disp_table_init
);
/* Adjust linger time for our sockets */
...
...
@@ -675,14 +675,14 @@ static disp_table_err_e _devio_check_msg_args (disp_table_t *disp_table,
assert
(
disp_op
);
assert
(
args
);
d
evio_err_e
err
=
DEVIO
_SUCCESS
;
d
isp_table_err_e
err
=
DISP_TABLE
_SUCCESS
;
/* Check if the message
t
is the correct one */
/* Check if the message is the correct one */
ASSERT_TEST
(
msg_guess_type
(
args
)
==
MSG_THSAFE_ZMQ
,
"Invalid message tag"
,
err_inv_msg
,
D
EVIO
_ERR_BAD_MSG
);
err_inv_msg
,
D
ISP_TABLE
_ERR_BAD_MSG
);
msg_err_e
merr
=
msg_check_gen_zmq_args
(
disp_op
,
THSAFE_MSG_ZMQ
(
args
));
ASSERT_TEST
(
merr
==
MSG_SUCCESS
,
"Unrecognized message. Message arguments "
"checking failed"
,
err_msg_args_check
,
D
EVIO
_ERR_BAD_MSG
);
"checking failed"
,
err_msg_args_check
,
D
ISP_TABLE
_ERR_BAD_MSG
);
err_msg_args_check:
err_inv_msg:
...
...
@@ -707,7 +707,7 @@ static devio_err_e _devio_do_smio_op (devio_t *self, void *msg)
disp_table_t
*
disp_table
=
self
->
disp_table_thsafe_ops
;
msg_err_e
merr
=
msg_handle_sock_request
(
self
,
msg
,
disp_table
);
ASSERT_TEST
(
merr
==
MSG_SUCCESS
,
"Error handling request"
,
err_hand_req
,
SMIO_ERR_MSG_NOT_SUP
P
/* returning a more meaningful error? */
);
DEVIO_ERR_SMIO_DO_O
P
/* returning a more meaningful error? */
);
err_hand_req:
return
err
;
...
...
src/sm_io/chips/sm_ch_pca9547.c
View file @
1563dbef
...
...
@@ -103,7 +103,7 @@ smch_err_e smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data)
static
smch_err_e
_smch_pca9547_write_8
(
smch_pca9547_t
*
self
,
const
uint8_t
*
data
)
{
sm
pr_err_e
err
=
SMPR
_SUCCESS
;
sm
ch_err_e
err
=
SMCH
_SUCCESS
;
uint32_t
trans_size
=
PCA9547_DATA_TRANS_SIZE
;
uint32_t
flags
=
SMPR_PROTO_I2C_TRANS_SIZE_FLAGS_W
(
trans_size
)
/* in bits */
|
SMPR_PROTO_I2C_ADDR_FLAGS_W
(
self
->
addr
);
...
...
@@ -118,7 +118,7 @@ static smch_err_e _smch_pca9547_write_8 (smch_pca9547_t *self, const uint8_t *da
ssize_t
smpr_err
=
smpr_write_32
(
self
->
i2c
,
0
,
(
uint32_t
*
)
data
,
flags
);
ASSERT_TEST
(
smpr_err
==
PCA9547_DATA_TRANS_SIZE
/
SMPR_BYTE_2_BIT
/* in bytes*/
,
"Could not write data to I2C"
,
err_exit
,
-
1
);
"Could not write data to I2C"
,
err_exit
,
SMCH_ERR_RW_SMPR
);
err_exit:
return
err
;
...
...
@@ -126,7 +126,7 @@ err_exit:
static
smch_err_e
_smch_pca9547_read_8
(
smch_pca9547_t
*
self
,
uint8_t
*
data
)
{
sm
pr_err_e
err
=
SMPR
_SUCCESS
;
sm
ch_err_e
err
=
SMCH
_SUCCESS
;
uint32_t
trans_size
=
PCA9547_DATA_TRANS_SIZE
;
uint32_t
flags
=
SMPR_PROTO_I2C_TRANS_SIZE_FLAGS_W
(
trans_size
)
/* in bits */
|
SMPR_PROTO_I2C_ADDR_FLAGS_W
(
self
->
addr
);
...
...
@@ -139,7 +139,7 @@ static smch_err_e _smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data)
ssize_t
smpr_err
=
smpr_read_32
(
self
->
i2c
,
0
,
(
uint32_t
*
)
data
,
flags
);
ASSERT_TEST
(
smpr_err
==
PCA9547_DATA_TRANS_SIZE
/
SMPR_BYTE_2_BIT
/* in bytes*/
,
"Could not read data to I2C"
,
err_exit
,
-
1
);
"Could not read data to I2C"
,
err_exit
,
SMCH_ERR_RW_SMPR
);
DBE_DEBUG
(
DBG_SM_CH
|
DBG_LVL_TRACE
,
"[sm_ch:pca9547_read_8] data = 0x%02X
\n
"
,
*
data
);
...
...
src/sm_io/sm_io.c
View file @
1563dbef
...
...
@@ -255,14 +255,14 @@ static disp_table_err_e _smio_check_msg_args (disp_table_t *disp_table,
assert
(
disp_op
);
assert
(
args
);
smio_err_e
err
=
SMIO
_SUCCESS
;
disp_table_err_e
err
=
DISP_TABLE
_SUCCESS
;
/* Check if the message tis the correct one */
ASSERT_TEST
(
msg_guess_type
(
args
)
==
MSG_EXP_ZMQ
,
"Invalid message tag"
,
err_inv_msg
,
SMIO_ERR_MSG_NOT_SUPP
);
err_inv_msg
,
DISP_TABLE_ERR_BAD_MSG
);
msg_err_e
merr
=
msg_check_gen_zmq_args
(
disp_op
,
EXP_MSG_ZMQ
(
args
));
ASSERT_TEST
(
merr
==
MSG_SUCCESS
,
"Unrecognized message. Message arguments "
"checking failed"
,
err_msg_args_check
,
SMIO_ERR_MSG_NOT_SUPP
);
"checking failed"
,
err_msg_args_check
,
DISP_TABLE_ERR_BAD_MSG
);
err_msg_args_check:
err_inv_msg:
...
...
@@ -315,8 +315,8 @@ smio_err_e smio_export_ops (smio_t *self, const disp_op_t** smio_exp_ops)
smio_err_e
err
=
SMIO_SUCCESS
;
hutils_err_e
h
err
=
disp_table_insert_all
(
self
->
exp_ops_dtable
,
smio_exp_ops
);
ASSERT_TEST
(
h
err
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not export"
disp_table_err_e
d
err
=
disp_table_insert_all
(
self
->
exp_ops_dtable
,
smio_exp_ops
);
ASSERT_TEST
(
d
err
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not export"
" SMIO ops"
,
err_export_op
,
SMIO_ERR_EXPORT_OP
);
err
=
SMIO_FUNC_OPS_NOFAIL_WRAPPER
(
err
,
export_ops
,
smio_exp_ops
);
...
...
@@ -334,9 +334,9 @@ smio_err_e smio_unexport_ops (smio_t *self)
assert
(
self
);
smio_err_e
err
=
SMIO_SUCCESS
;
hutils_err_e
h
err
=
disp_table_remove_all
(
self
->
exp_ops_dtable
);
disp_table_err_e
d
err
=
disp_table_remove_all
(
self
->
exp_ops_dtable
);
ASSERT_TEST
(
h
err
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not unexport SMIO ops"
,
ASSERT_TEST
(
d
err
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not unexport SMIO ops"
,
err_unexport_op
,
SMIO_ERR_EXPORT_OP
);
err
=
SMIO_FUNC_OPS_NOFAIL_WRAPPER
(
err
,
unexport_ops
);
...
...
@@ -358,10 +358,10 @@ smio_err_e smio_init_exp_ops (smio_t *self, disp_op_t** smio_exp_ops,
{
assert
(
self
);
hutils_err_e
herr
=
HUTILS
_SUCCESS
;
disp_table_err_e
derr
=
DISP_TABLE
_SUCCESS
;
smio_err_e
err
=
SMIO_SUCCESS
;
h
err
=
disp_table_fill_desc
(
self
->
exp_ops_dtable
,
smio_exp_ops
,
func_fps
);
ASSERT_TEST
(
h
err
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not export"
d
err
=
disp_table_fill_desc
(
self
->
exp_ops_dtable
,
smio_exp_ops
,
func_fps
);
ASSERT_TEST
(
d
err
==
HUTILS_SUCCESS
,
"smio_export_ops: Could not export"
" fill SMIO ops description"
,
err_fill_desc_ops
,
SMIO_ERR_EXPORT_OP
);
err_fill_desc_ops:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment