hi Davis,
Thanks for your great help to me!
Yeah, the library may had a design principle when it was
designed, as you can see the buffer appender is not that suitable
for an application-defined structured data packing.
And after I turn to the bitfield, I then got another trouble:
The
On Monday, December 18, 2017 08:45:32 Binghoo Dang via Digitalmars-d-learn
wrote:
> hi Davis,
>
> I read the std.bitmanip, and I tried to test the code like below:
>
> ```
> import std.stdio;
> import std.array;
> import std.bitmanip;
> void main(string[] args)
> {
> align(1) struct c {
>
On Monday, December 18, 2017 05:32:02 Binghoo Dang via Digitalmars-d-learn
wrote:
> Thanks for your idea.
>
> On Monday, 18 December 2017 at 05:08:24 UTC, Jonathan M Davis
>
> wrote:
> >> ubyte[] makeCMDPacket(RCPCmd cmd, in ubyte[] data)
> >> {
> >>
> >>
hi Davis,
I read the std.bitmanip, and I tried to test the code like below:
```
import std.stdio;
import std.array;
import std.bitmanip;
void main(string[] args)
{
align(1) struct c {
ushort c1;
uint c2;
//ubyte[8] c3;
}
ubyte[] buffer;
auto ap =
Thanks for your idea.
On Monday, 18 December 2017 at 05:08:24 UTC, Jonathan M Davis
wrote:
ubyte[] makeCMDPacket(RCPCmd cmd, in ubyte[] data)
{
this.preamble = RCPPKT_PRE;
this.hdr.msgtype = RCPMSG_CMD;
this.hdr.cmdcode = cast (ubyte)
On Monday, December 18, 2017 03:00:47 Binghoo Dang via Digitalmars-d-learn
wrote:
> hi,
>
> I'm a dlang newbie, and I recently made a program that interacts
> with an RFID Reader, it's basically a Serial-Port communication
> model. And after 2 days, I finally got a working code like these:
>
>
hi,
I'm a dlang newbie, and I recently made a program that interacts
with an RFID Reader, it's basically a Serial-Port communication
model. And after 2 days, I finally got a working code like these:
```
enum RCPCmd{
RCPCMD_GET_REGION = 0x06,
RCPCMD_SET_REGION = 0x07,