Or should I call the Mac::sendUp(Packet* p)? And where I should call it?
- before if(tx_active_ && hdr->error() == 0) ?
- before if(rx_state_ == MAC_IDLE)?
- or at the end of the method?
The method Mac802_11::recv is copied below. Thanks again!
Larissa
void
Mac802_11::recv(Packet *p, Handler *h)
{
struct hdr_cmn *hdr = HDR_CMN(p);
/*
* Sanity Check
*/
assert(initialized());
/*
* Handle outgoing packets.
*/
if(hdr->direction() == hdr_cmn::DOWN) {
send(p, h);
return;
}
/*
* Handle incoming packets.
*
* We just received the 1st bit of a packet on the network
* interface.
*
*/
/*
* If the interface is currently in transmit mode, then
* it probably won't even see this packet. However, the
* "air" around me is BUSY so I need to let the packet
* proceed. Just set the error flag in the common header
* to that the packet gets thrown away.
*/
if(tx_active_ && hdr->error() == 0) {
hdr->error() = 1;
}
if(rx_state_ == MAC_IDLE) {
setRxState(MAC_RECV);
pktRx_ = p;
/*
* Schedule the reception of this packet, in
* txtime seconds.
*/
if (mhProbe_.busy() && OnMinChannelTime) {
Recv_Busy_ = 1; // Receiver busy indication for Probe Timer
}
mhRecv_.start(txtime(p));
} else {
/*
* If the power of the incoming packet is smaller than the
* power of the packet currently being received by at least
* the capture threshold, then we ignore the new packet.
*/
if(pktRx_->txinfo_.RxPr / p->txinfo_.RxPr >= p->txinfo_.CPThresh) {
capture(p);
} else {
collision(p);
}
}
}
On Thu, Mar 4, 2010 at 09:49, Larissa Lucena <[email protected]>wrote:
> What I do? Test the kind of packet, and if it might be sent up, call the
> recv of the mac superclass?
>
> I'm seeming kind desperate, no? But I think I really am! LOL
>
> Larissa
>
>
> On Thu, Mar 4, 2010 at 09:24, Larissa Lucena <[email protected]>wrote:
>
>> Thanks, Lionel! I'll try It now!
>>
>> But (still) if anyone had an example e could send me, I'm very gratefull!
>>
>> Larissa
>>
>> On Thu, Mar 4, 2010 at 04:29, Lionel Bertaux <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> If you take a look at thé recv method, you CAN see that packets are sent
>>> up or down depending on their characteristics. You just have to change the
>>> conditions needed to send your packet up (like thé packet type in the common
>>> header).
>>>
>>> Enjoy.
>>>
>>> Lionel Bertaux.
>>>
>>>
>>>
>>> Le 3 mars 2010 à 22:15, Larissa Lucena <[email protected]> a écrit
>>> :
>>>
>>>
>>>
>>>> On Wed, Mar 3, 2010 at 18:11, Larissa Lucena <[email protected]
>>>> >wrote:
>>>>
>>>> Hi, there!
>>>>>
>>>>> I would like to know how to modificate Mac802_11::recv to send up my
>>>>> application protocol packets. Has anyone an example?
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Larissa
>>>>>
>>>>> --
>>>>> "O maior prazer do inteligente é bancar o idiota
>>>>> diante de um idiota que banca o inteligente".
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> "O maior prazer do inteligente é bancar o idiota
>>>> diante de um idiota que banca o inteligente".
>>>>
>>>
>>
>>
>> --
>> "O maior prazer do inteligente é bancar o idiota
>> diante de um idiota que banca o inteligente".
>>
>
>
>
> --
> "O maior prazer do inteligente é bancar o idiota
> diante de um idiota que banca o inteligente".
>
--
"O maior prazer do inteligente é bancar o idiota
diante de um idiota que banca o inteligente".