Raise a runtime error if the transmit fails

git-svn-id: file:///home/svn/framework3/trunk@5141 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2007-10-09 04:12:13 +00:00
parent 5b66434516
commit 347ff2ed7f
1 changed files with 3 additions and 1 deletions

View File

@ -489,8 +489,10 @@ static VALUE lorcon_device_write(int argc, VALUE *argv, VALUE self) {
for (; cnt > 0; cnt--) {
ret = tx80211_txpacket(&rld->in_tx, &rld->in_packet);
if (ret < 0)
if (ret < 0) {
rb_raise(rb_eRuntimeError, "Lorcon could not transmit packet: %s", tx80211_geterrstr(&rld->in_tx));
return(INT2NUM(ret));
}
if (dly > 0)
#ifdef _MSC_VER
Sleep(dly);