WIP_BOPT_ERROR 220 Undocumented?


#1

I’m doing GPRS session with FXT001 acting as client connecting to a pc server-side.

In “GprsBearer_EventHandler(wip_bearer_t bearer, s8 event, void * context)” i receive WIP_BEV_CONN_FAILED, so i call wip_bearerGetOpts() as following code:

if (wip_bearerGetOpts(gprs_Bearer, WIP_BOPT_ERROR, &error, WIP_BOPT_END) == 0)
{
  TraceGprsError(error);
}

In function TraceGprsError() i evaluate all possible case of errors:

void TraceGprsError(int error)
{
	switch(error)
	{
		case WIP_BERR_NO_DEV: TRACE((TDL_GPRS, "WIP_BERR_NO_DEV")); break;
		case WIP_BERR_ALREADY: TRACE((TDL_GPRS, "WIP_BERR_ALREADY")); break;
		case WIP_BERR_NO_IF: TRACE((TDL_GPRS, "WIP_BERR_NO_IF")); break;
		case WIP_BERR_NO_HDL: TRACE((TDL_GPRS, "WIP_BERR_NO_HDL")); break;
		case WIP_BERR_BAD_HDL: TRACE((TDL_GPRS, "WIP_BERR_BAD_HDL")); break;
		case WIP_BERR_OPTION: TRACE((TDL_GPRS, "WIP_BERR_OPTION")); break;
		case WIP_BERR_PARAM: TRACE((TDL_GPRS, "WIP_BERR_PARAM")); break;
		case WIP_BERR_OK_INPROGRESS: TRACE((TDL_GPRS, "WIP_BERR_OK_INPROGRESS")); break;
		case WIP_BERR_BAD_STATE: TRACE((TDL_GPRS, "WIP_BERR_BAD_STATE")); break;
		case WIP_BERR_DEV: TRACE((TDL_GPRS, "WIP_BERR_DEV")); break;
		case WIP_BERR_NOT_SUPPORTED: TRACE((TDL_GPRS, "WIP_BERR_NOT_SUPPORTED")); break;
		case WIP_BERR_LINE_BUSY: TRACE((TDL_GPRS, "WIP_BERR_LINE_BUSY")); break;
		case WIP_BERR_NO_ANSWER: TRACE((TDL_GPRS, "WIP_BERR_NO_ANSWER")); break;
		case WIP_BERR_NO_CARRIER: TRACE((TDL_GPRS, "WIP_BERR_NO_CARRIER")); break;
		case WIP_BERR_NO_SIM: TRACE((TDL_GPRS, "WIP_BERR_NO_SIM")); break;
		case WIP_BERR_PIN_NOT_READY: TRACE((TDL_GPRS, "WIP_BERR_PIN_NOT_READY")); break;
		case WIP_BERR_GPRS_FAILED: TRACE((TDL_GPRS, "WIP_BERR_GPRS_FAILED")); break;
		case WIP_BERR_PPP_LCP_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_LCP_FAILED")); break;
		case WIP_BERR_PPP_AUTH_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_AUTH_FAILED")); break;
		case WIP_BERR_PPP_IPCP_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_IPCP_FAILED")); break;
		case WIP_BERR_PPP_LINK_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_LINK_FAILED")); break;
		case WIP_BERR_PPP_TERM_REQ: TRACE((TDL_GPRS, "WIP_BERR_PPP_TERM_REQ")); break;
		case WIP_BERR_CALL_REFUSED: TRACE((TDL_GPRS, "WIP_BERR_CALL_REFUSED")); break;
		case WIP_BERR_NO_MEM: TRACE((TDL_GPRS, "WIP_BERR_NO_MEM")); break;

		default:
			TRACE((TDL_GPRS, "NO ERROR CODE FOUND."));
		break;
	}
}

But i get 220 as error code returned by wip_bearerGetOpts() which is not covered in “wip_bearer.h”.
What does it means this error code ?


#2

Hi,

I haven’t ever encountered this problem. Looking through your code I noticed that your function TraceGprsError(int error) takes an INT as an input.

What I would try is making your variables all s8, as the documentation suggests.

eg.

s8 error;

if (wip_bearerGetOpts(gprs_Bearer, WIP_BOPT_ERROR, &error, WIP_BOPT_END) == 0)
{
  TraceGprsError(error);
}

void TraceGprsError(s8 error)
{
   switch(error)
   {
      case WIP_BERR_NO_DEV: TRACE((TDL_GPRS, "WIP_BERR_NO_DEV")); break;
      case WIP_BERR_ALREADY: TRACE((TDL_GPRS, "WIP_BERR_ALREADY")); break;
      case WIP_BERR_NO_IF: TRACE((TDL_GPRS, "WIP_BERR_NO_IF")); break;
      case WIP_BERR_NO_HDL: TRACE((TDL_GPRS, "WIP_BERR_NO_HDL")); break;
      case WIP_BERR_BAD_HDL: TRACE((TDL_GPRS, "WIP_BERR_BAD_HDL")); break;
      case WIP_BERR_OPTION: TRACE((TDL_GPRS, "WIP_BERR_OPTION")); break;
      case WIP_BERR_PARAM: TRACE((TDL_GPRS, "WIP_BERR_PARAM")); break;
      case WIP_BERR_OK_INPROGRESS: TRACE((TDL_GPRS, "WIP_BERR_OK_INPROGRESS")); break;
      case WIP_BERR_BAD_STATE: TRACE((TDL_GPRS, "WIP_BERR_BAD_STATE")); break;
      case WIP_BERR_DEV: TRACE((TDL_GPRS, "WIP_BERR_DEV")); break;
      case WIP_BERR_NOT_SUPPORTED: TRACE((TDL_GPRS, "WIP_BERR_NOT_SUPPORTED")); break;
      case WIP_BERR_LINE_BUSY: TRACE((TDL_GPRS, "WIP_BERR_LINE_BUSY")); break;
      case WIP_BERR_NO_ANSWER: TRACE((TDL_GPRS, "WIP_BERR_NO_ANSWER")); break;
      case WIP_BERR_NO_CARRIER: TRACE((TDL_GPRS, "WIP_BERR_NO_CARRIER")); break;
      case WIP_BERR_NO_SIM: TRACE((TDL_GPRS, "WIP_BERR_NO_SIM")); break;
      case WIP_BERR_PIN_NOT_READY: TRACE((TDL_GPRS, "WIP_BERR_PIN_NOT_READY")); break;
      case WIP_BERR_GPRS_FAILED: TRACE((TDL_GPRS, "WIP_BERR_GPRS_FAILED")); break;
      case WIP_BERR_PPP_LCP_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_LCP_FAILED")); break;
      case WIP_BERR_PPP_AUTH_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_AUTH_FAILED")); break;
      case WIP_BERR_PPP_IPCP_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_IPCP_FAILED")); break;
      case WIP_BERR_PPP_LINK_FAILED: TRACE((TDL_GPRS, "WIP_BERR_PPP_LINK_FAILED")); break;
      case WIP_BERR_PPP_TERM_REQ: TRACE((TDL_GPRS, "WIP_BERR_PPP_TERM_REQ")); break;
      case WIP_BERR_CALL_REFUSED: TRACE((TDL_GPRS, "WIP_BERR_CALL_REFUSED")); break;
      case WIP_BERR_NO_MEM: TRACE((TDL_GPRS, "WIP_BERR_NO_MEM")); break;

      default:
         TRACE((TDL_GPRS, "NO ERROR CODE FOUND."));
      break;
   }
}

Tyrone


#3

Thanks.