aboutsummaryrefslogtreecommitdiffstats
path: root/src/llc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/llc.h')
-rw-r--r--src/llc.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/llc.h b/src/llc.h
index b22b1c20..f83b9f95 100644
--- a/src/llc.h
+++ b/src/llc.h
@@ -50,19 +50,19 @@ struct gprs_llc {
bool fits_in_current_frame(uint8_t size) const;
uint8_t frame[LLC_MAX_LEN]; /* current DL or UL frame */
- uint16_t index; /* current write/read position of frame */
+ uint16_t m_index; /* current write/read position of frame */
uint16_t m_length; /* len of current DL LLC_frame, 0 == no frame */
struct llist_head queue; /* queued LLC DL data */
};
inline uint16_t gprs_llc::chunk_size() const
{
- return m_length - index;
+ return m_length - m_index;
}
inline uint16_t gprs_llc::remaining_space() const
{
- return LLC_MAX_LEN - index;
+ return LLC_MAX_LEN - m_index;
}
inline uint16_t gprs_llc::frame_length() const
@@ -72,17 +72,17 @@ inline uint16_t gprs_llc::frame_length() const
inline void gprs_llc::consume(size_t len)
{
- index += len;
+ m_index += len;
}
inline void gprs_llc::consume(uint8_t *data, size_t len)
{
/* copy and increment index */
- memcpy(data, frame + index, len);
- index += len;
+ memcpy(data, frame + m_index, len);
+ consume(len);
}
inline bool gprs_llc::fits_in_current_frame(uint8_t chunk_size) const
{
- return index + chunk_size <= LLC_MAX_LEN;
+ return m_index + chunk_size <= LLC_MAX_LEN;
}