#include "bluetooth_queue.h"


BulueQueueSTRUCT BLQ;

void BulueQueue_in_data(BulueQueueSTRUCT *in,unsigned char data)
{
    in->DATA[in->in_index++] = data;
}

unsigned char BulueQueue_out_data(BulueQueueSTRUCT *in)
{
    if(in->out_index == in->in_index)
    {
        return 0xFF;
    }
    else
    {
        return in->DATA[in->out_index++];
    }
}

bool BulueQueueIsEmty(BulueQueueSTRUCT *in)
{
    if(in->out_index == in->in_index)
    {
        return true;
    }
    else
    {
        return false;
    }
}

bool BulueQueueIsBusy(BulueQueueSTRUCT *in)
{
    if((in->in_index+1) == in->out_index)
    {
        return true;
    }
    else
    {
        return false;
    }
}

void BulueQueueClear(BulueQueueSTRUCT *in)
{
    in->in_index  = 0;
    in->out_index = 0;
}
