Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DynamixelSDK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nils Schulte
DynamixelSDK
Commits
da6eab74
Commit
da6eab74
authored
7 years ago
by
Leon Ryuwoon Jung
Browse files
Options
Downloads
Patches
Plain Diff
hotfix - now protocol1.0 read/write 4Byte available
parent
6ab926ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
c++/src/dynamixel_sdk/protocol1_packet_handler.cpp
+15
-5
15 additions, 5 deletions
c++/src/dynamixel_sdk/protocol1_packet_handler.cpp
ros/src/protocol1_packet_handler.cpp
+15
-5
15 additions, 5 deletions
ros/src/protocol1_packet_handler.cpp
with
30 additions
and
10 deletions
c++/src/dynamixel_sdk/protocol1_packet_handler.cpp
+
15
−
5
View file @
da6eab74
...
...
@@ -517,15 +517,23 @@ int Protocol1PacketHandler::read2ByteTxRx(PortHandler *port, uint8_t id, uint16_
int
Protocol1PacketHandler
::
read4ByteTx
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
)
{
return
COMM_NOT_AVAILABLE
;
return
readTx
(
port
,
id
,
address
,
4
)
;
}
int
Protocol1PacketHandler
::
read4ByteRx
(
PortHandler
*
port
,
uint32_t
*
data
,
uint8_t
*
error
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_read
[
4
]
=
{
0
};
int
result
=
readRx
(
port
,
4
,
data_read
,
error
);
if
(
result
==
COMM_SUCCESS
)
*
data
=
DXL_MAKEDWORD
(
DXL_MAKEWORD
(
data_read
[
0
],
data_read
[
1
]),
DXL_MAKEWORD
(
data_read
[
2
],
data_read
[
3
]));
return
result
;
}
int
Protocol1PacketHandler
::
read4ByteTxRx
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint32_t
*
data
,
uint8_t
*
error
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_read
[
4
]
=
{
0
};
int
result
=
readTxRx
(
port
,
id
,
address
,
4
,
data_read
,
error
);
if
(
result
==
COMM_SUCCESS
)
*
data
=
DXL_MAKEDWORD
(
DXL_MAKEWORD
(
data_read
[
0
],
data_read
[
1
]),
DXL_MAKEWORD
(
data_read
[
2
],
data_read
[
3
]));
return
result
;
}
int
Protocol1PacketHandler
::
writeTxOnly
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint16_t
length
,
uint8_t
*
data
)
...
...
@@ -600,11 +608,13 @@ int Protocol1PacketHandler::write2ByteTxRx(PortHandler *port, uint8_t id, uint16
int
Protocol1PacketHandler
::
write4ByteTxOnly
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint32_t
data
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_write
[
4
]
=
{
DXL_LOBYTE
(
DXL_LOWORD
(
data
)),
DXL_HIBYTE
(
DXL_LOWORD
(
data
)),
DXL_LOBYTE
(
DXL_HIWORD
(
data
)),
DXL_HIBYTE
(
DXL_HIWORD
(
data
))
};
return
writeTxOnly
(
port
,
id
,
address
,
4
,
data_write
);
}
int
Protocol1PacketHandler
::
write4ByteTxRx
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint32_t
data
,
uint8_t
*
error
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_write
[
4
]
=
{
DXL_LOBYTE
(
DXL_LOWORD
(
data
)),
DXL_HIBYTE
(
DXL_LOWORD
(
data
)),
DXL_LOBYTE
(
DXL_HIWORD
(
data
)),
DXL_HIBYTE
(
DXL_HIWORD
(
data
))
};
return
writeTxRx
(
port
,
id
,
address
,
4
,
data_write
,
error
);
}
int
Protocol1PacketHandler
::
regWriteTxOnly
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint16_t
length
,
uint8_t
*
data
)
...
...
This diff is collapsed.
Click to expand it.
ros/src/protocol1_packet_handler.cpp
+
15
−
5
View file @
da6eab74
...
...
@@ -523,15 +523,23 @@ int Protocol1PacketHandler::read2ByteTxRx(PortHandler *port, uint8_t id, uint16_
int
Protocol1PacketHandler
::
read4ByteTx
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
)
{
return
COMM_NOT_AVAILABLE
;
return
readTx
(
port
,
id
,
address
,
4
)
;
}
int
Protocol1PacketHandler
::
read4ByteRx
(
PortHandler
*
port
,
uint8_t
id
,
uint32_t
*
data
,
uint8_t
*
error
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_read
[
4
]
=
{
0
};
int
result
=
readRx
(
port
,
4
,
data_read
,
error
);
if
(
result
==
COMM_SUCCESS
)
*
data
=
DXL_MAKEDWORD
(
DXL_MAKEWORD
(
data_read
[
0
],
data_read
[
1
]),
DXL_MAKEWORD
(
data_read
[
2
],
data_read
[
3
]));
return
result
;
}
int
Protocol1PacketHandler
::
read4ByteTxRx
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint32_t
*
data
,
uint8_t
*
error
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_read
[
4
]
=
{
0
};
int
result
=
readTxRx
(
port
,
id
,
address
,
4
,
data_read
,
error
);
if
(
result
==
COMM_SUCCESS
)
*
data
=
DXL_MAKEDWORD
(
DXL_MAKEWORD
(
data_read
[
0
],
data_read
[
1
]),
DXL_MAKEWORD
(
data_read
[
2
],
data_read
[
3
]));
return
result
;
}
int
Protocol1PacketHandler
::
writeTxOnly
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint16_t
length
,
uint8_t
*
data
)
...
...
@@ -606,11 +614,13 @@ int Protocol1PacketHandler::write2ByteTxRx(PortHandler *port, uint8_t id, uint16
int
Protocol1PacketHandler
::
write4ByteTxOnly
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint32_t
data
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_write
[
4
]
=
{
DXL_LOBYTE
(
DXL_LOWORD
(
data
)),
DXL_HIBYTE
(
DXL_LOWORD
(
data
)),
DXL_LOBYTE
(
DXL_HIWORD
(
data
)),
DXL_HIBYTE
(
DXL_HIWORD
(
data
))
};
return
writeTxOnly
(
port
,
id
,
address
,
4
,
data_write
);
}
int
Protocol1PacketHandler
::
write4ByteTxRx
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint32_t
data
,
uint8_t
*
error
)
{
return
COMM_NOT_AVAILABLE
;
uint8_t
data_write
[
4
]
=
{
DXL_LOBYTE
(
DXL_LOWORD
(
data
)),
DXL_HIBYTE
(
DXL_LOWORD
(
data
)),
DXL_LOBYTE
(
DXL_HIWORD
(
data
)),
DXL_HIBYTE
(
DXL_HIWORD
(
data
))
};
return
writeTxRx
(
port
,
id
,
address
,
4
,
data_write
,
error
);
}
int
Protocol1PacketHandler
::
regWriteTxOnly
(
PortHandler
*
port
,
uint8_t
id
,
uint16_t
address
,
uint16_t
length
,
uint8_t
*
data
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment