diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-04-23 17:21:49 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-04-23 17:21:49 +0200 |
commit | 2a609f9054147e7ee64e084ded8a38a4cc392501 (patch) | |
tree | 7e972f08d877f96aa4d9d9a127caacb5d8fa135a /gatchat/gathdlc.c | |
parent | a31870f54255b1e3ac0832d30a114ea415ee9698 (diff) | |
download | ofono-2a609f9054147e7ee64e084ded8a38a4cc392501.tar.bz2 |
Use HDLC constants instead of magic numbers
Diffstat (limited to 'gatchat/gathdlc.c')
-rw-r--r-- | gatchat/gathdlc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gatchat/gathdlc.c b/gatchat/gathdlc.c index e0605560..fcf53162 100644 --- a/gatchat/gathdlc.c +++ b/gatchat/gathdlc.c @@ -319,9 +319,9 @@ static inline void hdlc_put(GAtHDLC *hdlc, guint8 *buf, gsize *pos, guint8 c) { gsize i = *pos; - if (c == 0x7e || c == 0x7d) { - buf[i++] = 0x7d; - buf[i++] = c ^ 0x20; + if (c == HDLC_FLAG || c == HDLC_ESCAPE) { + buf[i++] = HDLC_ESCAPE; + buf[i++] = c ^ HDLC_TRANS; } else buf[i++] = c; @@ -352,7 +352,7 @@ gboolean g_at_hdlc_send(GAtHDLC *hdlc, const unsigned char *data, gsize size) hdlc_put(hdlc, buf, &pos, fcs & 0xff); hdlc_put(hdlc, buf, &pos, fcs >> 8); - buf[pos++] = 0x7e; + buf[pos++] = HDLC_FLAG; ring_buffer_write_advance(hdlc->write_buffer, pos); } while (0); |