Helper library to use modem_ref driver.

Dependencies:   WizziCom WizziDebug ram_fs modem_ref

Dependents:   D7A_Localisation D7A_1x_demo_send_file_data_and_forget D7A_1x_demo_CodeUpgradeProtocol D7A_1x_demo_LoRaWAN ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers modem_d7a.cpp Source File

modem_d7a.cpp

00001 
00002 #include "mbed.h"
00003 #include "modem_d7a.h"
00004 #include "modem_cup.h"
00005 
00006 #if 0
00007 #define HELPER_PRINT(...)  PRINT(__VA_ARGS__)
00008 #else
00009 #define HELPER_PRINT(...);
00010 #endif
00011 
00012 #define MODEM_VERSION_MAJOR         5
00013 #define MODEM_VERSION_MINOR         6
00014 #define MODEM_VERSION_PATCH         0
00015 #define MODEM_DEVICE_ID             0x00001001
00016 
00017 Semaphore g_s[MAX_USER_NB];
00018 
00019 static WizziCom* g_modem_com;
00020 
00021 // Callback for id User
00022 static void modem_cb(uint8_t id)
00023 {
00024     (void)id;
00025     
00026     HELPER_PRINT("CB ID:%d\n", id);
00027 
00028     g_s[id].release();
00029 }
00030 
00031 static int g_boot_nb;
00032 static int g_read_nb;
00033 static int g_swr_nb;
00034 static int g_hwr_nb;
00035 static int g_pwc_nb;
00036 static int g_fail_nb;
00037 
00038 int my_alp_itf_d7a_cfg_size(d7a_sp_cfg_t* cfg)
00039 {
00040     int size = sizeof(d7a_sp_cfg_t) - sizeof(d7a_addressee_t);
00041     size += D7A_ADDR_LEN(cfg->addressee.ctrl);
00042     return size;
00043 }
00044 
00045 // ============================================================}}}
00046 
00047 // Serial adapters to WizziLab's own architecture
00048 // ============================================================{{{
00049 
00050 static void modem_serial_input(WizziCom* com, WizziComPacket_t* pkt)
00051 {
00052     modem_ref_input(wizzicom_type_to_flow(pkt->type), pkt->data, pkt->length);
00053 }
00054 
00055 static int modem_serial_send(uint8_t type, uint8_t* data, uint8_t size)
00056 {
00057     // Retrieve Flow ID from header and send packet
00058     g_modem_com->send((WizziComPacketType)type, size, data);
00059 
00060     return size;
00061 }
00062 
00063 static Semaphore boot(0);
00064 void my_startup_boot(u8 cause, u16 number)
00065 {
00066     HELPER_PRINT("Modem BOOT[%c] #%d\r\n", cause, number);
00067     boot.release();
00068 }
00069 
00070 int modem_open(modem_ref_callbacks_t* callbacks)
00071 {
00072     static union {
00073         uint8_t      b[8];
00074         uint32_t     w[2];
00075     } uid;
00076     revision_t rev;
00077     int err;
00078     
00079     //for (int i = 0; i < MAX_USER_NB; i++)
00080     //{
00081         //g_s[i] = Semaphore(0);
00082     //}
00083 
00084     g_boot_nb++;
00085 
00086     // Override boot callback to catch the first boot message
00087     modem_ref_callbacks_t boot_callbacks = {
00088         .read       = NULL,
00089         .write      = NULL,
00090         .read_fprop = NULL,
00091         .flush      = NULL,
00092         .remove     = NULL,
00093         .udata      = NULL,
00094         .reset      = NULL,
00095         .boot       = my_startup_boot,
00096     };
00097 
00098     // Open modem Com port
00099     g_modem_com = new WizziCom(MODEM_PIN_RX, MODEM_PIN_TX, MODEM_PIN_IRQ_IN, MODEM_PIN_IRQ_OUT);
00100 
00101     // open with user callbacks
00102     modem_ref_open(modem_serial_send, callbacks);
00103 
00104     // Redirect All Port traffic to modem_serial_input
00105     g_modem_com->attach(modem_serial_input, WizziComPacketUntreated);
00106 
00107     // Wait for modem power up
00108     ThisThread::sleep_for(100);
00109 
00110     // Try reading UID
00111     err = modem_read_file(D7A_FID_UID, uid.b, 0, 8);
00112 
00113     if (ALP_ERR_NONE > err)
00114     {
00115         PRINT("Trying software reset...\n");
00116 
00117         // Open driver to catch boot packet
00118         modem_ref_close();
00119         modem_ref_open(NULL, &boot_callbacks);
00120 
00121         // Try software reset
00122         g_modem_com->send(WizziComPacketSysReset, 0, NULL);
00123 
00124         if (!boot.try_acquire_for(1000))
00125         {
00126             PRINT("Trying hardware reset...\n");
00127 
00128             // Assert reset pin
00129             DigitalOut reset_low(MODEM_PIN_RESET, 0);
00130             ThisThread::sleep_for(100);
00131 
00132             // Release reset pin
00133             DigitalIn reset_release(MODEM_PIN_RESET);
00134 
00135             if (!boot.try_acquire_for(1000))
00136             {
00137 #if 0
00138                 // Modem not responding!
00139                 PRINT("Trying power cycle.\n");
00140 
00141                 // Assert power pin
00142                 DigitalOut power_high(D12, 1);
00143                 ThisThread::sleep_for(1000);
00144 
00145                 // Release reset pin
00146                 DigitalIn power_release(D12);
00147 
00148                 if (boot.try_acquire_for(1000))
00149                 {
00150                     g_pwc_nb++;
00151                     PRINT("Modem is up after power cycle.\n");
00152                 }
00153                 else
00154 #endif
00155                 {
00156                     // Modem not responding!
00157                     g_fail_nb++;
00158                     PRINT("Failed to open modem.\n");
00159                     return -1;
00160                 }
00161             }
00162             else
00163             {
00164                 g_hwr_nb++;
00165                 PRINT("Modem is up after hardware reset.\n");
00166             }
00167         }
00168         else
00169         {
00170             g_swr_nb++;
00171             PRINT("Modem is up after software reset.\n");
00172         }
00173         
00174         // Re-open with user callbacks
00175         modem_ref_close();
00176         modem_ref_open(modem_serial_send, callbacks);
00177     }
00178     else
00179     {
00180         g_read_nb++;
00181         PRINT("Modem is up.\n");
00182     }
00183 
00184     PRINT("Boot stats: boot:%d read:%d swr:%d hwr:%d pwc:%d fail:%d\n", g_boot_nb, g_read_nb, g_swr_nb, g_hwr_nb, g_pwc_nb, g_fail_nb);
00185 
00186     ThisThread::sleep_for(100);
00187 
00188     modem_read_file(D7A_FID_UID, uid.b, 0, 8);
00189     modem_read_file(D7A_FID_FIRMWARE_VERSION, (uint8_t*)&rev, 0, sizeof(revision_t));
00190 
00191     PRINT("------------ D7A Modem infos ------------\r\n");
00192     PRINT_DATA(" - UID:              ", "%02X", uid.b, 8, "\r\n");
00193     PRINT(" - Manufacturer ID:  %08X\r\n", rev.manufacturer_id);
00194     PRINT(" - Device ID:        %08X\r\n", rev.device_id);
00195     PRINT(" - Hardware version: %08X\r\n", rev.hw_version);
00196     PRINT(" - Firmware version: v%d.%d.%d [%02X]\r\n", rev.fw_version.major, rev.fw_version.minor, rev.fw_version.patch, rev.fw_version.id);
00197     PRINT(" - CUP max size:     %d\r\n", rev.cup_max_size);
00198     PRINT("-----------------------------------------\r\n");
00199     FLUSH();
00200 
00201     modem_cup_update(&rev);
00202 
00203     return 0;
00204 }
00205 
00206 int modem_close(void)
00207 {
00208     modem_ref_close();
00209     delete g_modem_com;
00210 
00211     return 0;
00212 }
00213 
00214 static int _modem_d7a_send(void* itf, alp_payload_t* alp, alp_payload_t** alp_rsp, uint32_t timeout)
00215 {
00216     u8 id = modem_ref_get_id(modem_cb);
00217     int err = ALP_ERR_UNKNOWN;
00218     
00219     // Make sure Semaphore is taken
00220     g_s[id].try_acquire();
00221 
00222     modem_ref_alp(itf, alp, alp_rsp, id);
00223     if (!g_s[id].try_acquire_for(timeout))
00224     {
00225         PRINT("Modem_d7a timeout (%dms) on id %d\n", timeout, id);
00226         err = ALP_ERR_UNKNOWN;
00227     }
00228     else
00229     {
00230         err = ALP_ERR_NONE;
00231     }
00232 
00233     modem_ref_free_id(id);
00234 
00235     return err;
00236 }
00237 
00238 static int _modem_get_istatus(alp_payload_t* alp, void* istatus)
00239 {
00240     alp_payload_t* alp_tmp = alp_payload_get(alp, ALP_OPCODE_RSP_ISTATUS);
00241     
00242     if (alp_tmp)
00243     {
00244         alp_parsed_chunk_t r;
00245         u8* p = alp_tmp->d;
00246     
00247         alp_parse_chunk(&p, &r);
00248         memcpy(istatus, r.data, r.meta.itf.length);
00249         
00250         return ALP_ERR_NONE;
00251     }
00252     else
00253     {
00254         PRINT("No metadata\n");
00255     }
00256     
00257     return ALP_ERR_UNKNOWN;
00258 }
00259 
00260 int modem_raw_alp(alp_payload_t* alp, alp_payload_t** alp_rsp)
00261 {
00262     return _modem_d7a_send(NULL, alp, alp_rsp, MODEM_TIMEOUT_LOCAL);
00263 }
00264 
00265 int modem_remote_raw_alp(void* itf, alp_payload_t* alp, alp_payload_t** alp_rsp)
00266 {
00267     return _modem_d7a_send(itf, alp, alp_rsp, MODEM_TIMEOUT_DISTANT);
00268 }
00269 
00270 static int _modem_send_alp(void* itf, void *istatus, alp_payload_t* alp, uint32_t timeout)
00271 {
00272     int err = ALP_ERR_UNKNOWN;
00273     alp_payload_t* alp_rsp = NULL;
00274     
00275     err = _modem_d7a_send(itf, alp, &alp_rsp, timeout);
00276     
00277     do {
00278         if (ALP_ERR_NONE > err) { PRINT("Send ALP timeout\n"); break; }
00279 
00280         err = alp_payload_get_err(alp_rsp);
00281         
00282         if (ALP_ERR_NONE > err) { PRINT("Send ALP err %d\n", err); break; }
00283         
00284         if (istatus)
00285         {
00286             _modem_get_istatus(alp_rsp, istatus);
00287         }
00288     
00289     } while (0);
00290 
00291     alp_payload_free(alp_rsp);
00292 
00293     return err;
00294 }
00295 
00296 static int _modem_read_file(uint8_t* itf, void *istatus, uint8_t fid, void *data, uint32_t offset, uint32_t length, uint32_t timeout)
00297 {
00298     int err = ALP_ERR_UNKNOWN;
00299     alp_payload_t* alp = NULL;
00300     alp_payload_t* alp_rsp = NULL;
00301 
00302     alp = alp_payload_f_rd_data(NULL, fid, offset, length, false);
00303     
00304     err = _modem_d7a_send(NULL, alp, &alp_rsp, timeout);
00305     
00306     do {
00307         if (ALP_ERR_NONE > err) { PRINT("Read file timeout\n"); break; }
00308 
00309         err = alp_payload_get_err(alp_rsp);
00310         
00311         if (ALP_ERR_NONE > err) { PRINT("Read file err %d\n", err); break; }
00312         
00313         alp = alp_payload_get(alp_rsp, ALP_OPCODE_RSP_F_DATA);
00314         if (alp)
00315         {
00316             alp_parsed_chunk_t r;
00317             u8* p = alp->d;
00318             
00319             alp_parse_chunk(&p, &r);
00320             memcpy(data, r.data, r.meta.f_data.length);
00321         }
00322         else
00323         {
00324             PRINT("Read file no payload\n");
00325             err = ALP_ERR_UNKNOWN;
00326             break;
00327         }
00328         
00329         if (istatus)
00330         {
00331             _modem_get_istatus(alp_rsp, istatus);
00332         }
00333     
00334     } while (0);
00335 
00336     alp_payload_free(alp_rsp);
00337 
00338     return err;
00339 }
00340 
00341 int modem_read_file(uint8_t fid, void *data, uint32_t offset, uint32_t length)
00342 {
00343     return _modem_read_file(NULL, NULL, fid, data, offset, length, MODEM_TIMEOUT_LOCAL);
00344 }
00345 
00346 int modem_remote_read_file(uint8_t* itf, void *istatus, uint8_t fid, void *data, uint32_t offset, uint32_t length)
00347 {
00348     return _modem_read_file(itf, istatus, fid, data, offset, length, MODEM_TIMEOUT_DISTANT);
00349 }
00350 
00351 int modem_write_file(uint8_t fid, void *data, uint32_t offset, uint32_t length)
00352 {
00353     alp_payload_t* alp = alp_payload_f_wr_data(NULL, fid, data, offset, length, false);
00354     return _modem_send_alp(NULL, NULL, alp, MODEM_TIMEOUT_LOCAL);
00355 }
00356 
00357 int modem_remote_write_file(uint8_t* itf, void *istatus , uint8_t fid, void *data, uint32_t offset, uint32_t length)
00358 {
00359     alp_payload_t* alp = alp_payload_f_wr_data(NULL, fid, data, offset, length, false);
00360     return _modem_send_alp(itf, istatus, alp, MODEM_TIMEOUT_DISTANT);
00361 }
00362 
00363 int modem_flush_file(uint8_t fid)
00364 {
00365     alp_payload_t* alp = alp_payload_f_flush(NULL, fid, false);
00366     return _modem_send_alp(NULL, NULL, alp, MODEM_TIMEOUT_LOCAL);
00367 }
00368 
00369 int modem_declare_file(uint8_t fid, alp_file_header_t* header)
00370 {
00371     alp_payload_t* alp = alp_payload_f_declare(NULL, fid, header);
00372     return _modem_send_alp(NULL, NULL, alp, MODEM_TIMEOUT_LOCAL);
00373 }
00374 
00375 int modem_notify_file(uint8_t fid, uint32_t offset, uint32_t length)
00376 {
00377     alp_payload_t* alp = alp_payload_f_touch(NULL, fid, offset, length, false);
00378     return _modem_send_alp(NULL, NULL, alp, MODEM_TIMEOUT_LOCAL);
00379 }
00380 
00381 static int _modem_d7a_itf_enable(u8 enable)
00382 {
00383     alp_payload_t* alp = alp_payload_activate_itf(NULL, ALP_ITF_TYPE_D7A, 24, 0, ALP_D7A_ISTAT_RESP | ALP_D7A_ISTAT_UNS | ALP_D7A_ISTAT_EOP, enable);
00384     return _modem_send_alp(NULL, NULL, alp, MODEM_TIMEOUT_LOCAL);
00385 }
00386 
00387 int modem_d7a_enable_itf(void)
00388 {
00389     return _modem_d7a_itf_enable(true);
00390 }
00391 
00392 int modem_d7a_disable_itf(void)
00393 {
00394     return _modem_d7a_itf_enable(false);
00395 }
00396 
00397 static int modem_lwan_set_urc(void)
00398 {
00399     alp_payload_t* alp = alp_payload_urcc_en(NULL, ALP_URC_TYPE_ITF_BUSY, FID_LWAN_ITF, 1);
00400     return _modem_send_alp(NULL, NULL, alp, MODEM_TIMEOUT_LOCAL);
00401 }
00402 
00403 static int modem_lwan_enable_itf(void)
00404 {
00405     alp_payload_t* alp = alp_payload_activate_itf(NULL, ALP_ITF_TYPE_LWAN, 1, FID_LWAN_ITF, 0, true);
00406     return _modem_send_alp(NULL, NULL, alp, MODEM_TIMEOUT_LOCAL);
00407 }
00408 
00409 int modem_lwan_open(void)
00410 {
00411     int err = ALP_ERR_UNKNOWN;
00412         
00413     err = modem_lwan_set_urc();
00414     if (ALP_ERR_NONE > err) { return err; }
00415     
00416     err = modem_lwan_enable_itf();
00417     
00418     return err;
00419 }
00420 
00421 int modem_lwan_set_cfg(lwan_cfg_t* cfg)
00422 {    
00423     return modem_write_file(FID_LWAN_CFG, cfg, 0, sizeof(lwan_cfg_t));
00424 }
00425 
00426 int modem_lwan_set_nls(lwan_nls_t* nls)
00427 {
00428     return modem_write_file(FID_LWAN_NLS, nls, 0, sizeof(lwan_nls_t));
00429 }
00430 
00431 int modem_lwan_send(alp_payload_t* alp)
00432 {
00433     alp_itf_lwan_cfg_t itf = { .type = ALP_ITF_TYPE_LWAN };
00434     return _modem_d7a_send((void*)&itf, alp, NULL, MODEM_TIMEOUT_DISTANT);
00435 }
00436 
00437 int modem_lwan_get_status(lwan_status_t* status)
00438 {    
00439     return modem_read_file(FID_LWAN_STATUS, status, 0, sizeof(lwan_status_t));
00440 }
00441 
00442 void modem_print_error(uint8_t itf, int error)
00443 {
00444     if (ALP_ERR_ITF_START >= error && ALP_ERR_ITF_END < error)
00445     {
00446         error -= ALP_ERR_ITF_START;
00447         // Interface specific error
00448         if (ALP_ITF_TYPE_HOST == itf)
00449         {
00450             PRINT("ITF[%02X] Error %d\r\n", itf, error);
00451         }
00452         else if (ALP_ITF_TYPE_COM == itf)
00453         {
00454             PRINT("ITF[%02X] Error %d\r\n", itf, error);
00455         }
00456         else if (ALP_ITF_TYPE_D7A == itf)
00457         {
00458             PRINT("ITF[%02X] ", itf);
00459             switch (error)
00460             {
00461                 /// No error
00462                 case D7A_ERROR_NO: //            =  0,
00463                     PRINT("D7A_ERROR_NO\r\n");
00464                     break;
00465                     /// Resource busy
00466                 case D7A_ERROR_BUSY: //          = -1,
00467                     PRINT("D7A_ERROR_BUSY\r\n");
00468                     break;
00469                     /// Bad parameter
00470                 case D7A_ERROR_BAD_PARAM: //     = -2,
00471                     PRINT("D7A_ERROR_BAD_PARAM\r\n");
00472                     break;
00473                     /// Duty cycle limit overflow
00474                 case D7A_ERROR_DUTY_CYCLE: //    = -3,
00475                     PRINT("D7A_ERROR_DUTY_CYCLE\r\n");
00476                     break;
00477                     /// CCA timeout
00478                 case D7A_ERROR_CCA_TO: //        = -4,
00479                     PRINT("D7A_ERROR_CCA_TO\r\n");
00480                     break;
00481                     /// Security frame counter overflow
00482                 case D7A_ERROR_NLS_KEY: //       = -5,
00483                     PRINT("D7A_ERROR_NLS_KEY\r\n");
00484                     break;
00485                     /// TX stream underflow
00486                 case D7A_ERROR_TX_UDF: //        = -6,
00487                     PRINT("D7A_ERROR_TX_UDF\r\n");
00488                     break;
00489                     /// RX stream overflow
00490                 case D7A_ERROR_RX_OVF: //        = -7,
00491                     PRINT("D7A_ERROR_RX_OVF\r\n");
00492                     break;
00493                     /// RX checksum
00494                 case D7A_ERROR_RX_CRC: //        = -8,
00495                     PRINT("D7A_ERROR_RX_CRC\r\n");
00496                     break;
00497                     /// Abort
00498                 case D7A_ERROR_ABORT: //         = -9,
00499                     PRINT("D7A_ERROR_ABORT\r\n");
00500                     break;
00501                     /// No ACK received
00502                 case D7A_ERROR_NO_ACK: //        = -10,
00503                     PRINT("D7A_ERROR_NO_ACK\r\n");
00504                     break;
00505                     /// RX timeout
00506                 case D7A_ERROR_RX_TO: //         = -11,
00507                     PRINT("D7A_ERROR_RX_TO\r\n");
00508                     break;
00509                 default:
00510                     PRINT("Unknown Error %d\r\n", error);
00511                     break;
00512             }
00513         }
00514         else if (ALP_ITF_TYPE_LWAN == itf)
00515         {
00516             PRINT("ITF[%02X] Error %d\r\n", itf, error);
00517         }
00518         else
00519         {
00520             PRINT("ITF[%02X] Error %d\r\n", itf, error);
00521         }
00522     }
00523     else
00524     {
00525         PRINT("ITF[%02X] ALP: ", itf);
00526         switch (error)
00527         {
00528             // Not really errors, more like status
00529             case ALP_ERR_ITF_FULL: // 0x02: For interfaces supporting buffering, indicates buffer reached maximum capacity (no data loss)
00530                 PRINT("ALP_ERR_ITF_FULL\r\n");
00531                 break;
00532             case ALP_ERR_PARTIAL_COMPLETION: // 0x01: Action received and partially completed at response.  To be completed after response
00533                 PRINT("ALP_ERR_PARTIAL_COMPLETION\r\n");
00534                 break;
00535 
00536                 // ALP Errors
00537             case ALP_ERR_NONE: // 0x00: Action completed (OK)
00538                 PRINT("ALP_ERR_NONE\r\n");
00539                 break;
00540             case ALP_ERR_FILE_NOT_FOUND: // 0xFF: Error access file: File ID does not exist
00541                 PRINT("ALP_ERR_FILE_NOT_FOUND\r\n");
00542                 break;
00543             case ALP_ERR_FILE_EXIST: // 0xFE: Error create file: File ID already exists
00544                 PRINT("ALP_ERR_FILE_EXIST\r\n");
00545                 break;
00546             case ALP_ERR_FILE_NOT_RESTORABLE: // 0xFD: Error restore file: File is not restorable
00547                 PRINT("ALP_ERR_FILE_NOT_RESTORABLEr\n");
00548                 break;
00549             case ALP_ERR_PERMISSION_DENIED: // 0xFC: Error access file: Insufficient permissions
00550                 PRINT("ALP_ERR_PERMISSION_DENIED\r\n");
00551                 break;
00552             case ALP_ERR_LENGTH_OVERFLOW: // 0xFB: Error create file: Supplied length (in header) is beyond file limits
00553                 PRINT("ALP_ERR_LENGTH_OVERFLOW\r\n");
00554                 break;
00555             case ALP_ERR_ALLOC_OVERFLOW: // 0xFA: Error create file: Supplied allocation (in header) is beyond file limits
00556                 PRINT("ALP_ERR_ALLOC_OVERFLOW\r\n");
00557                 break;
00558             case ALP_ERR_OFFSET_OVERFLOW: // 0xF9: Error write: Supplied start offset is out of bounds of file allocation
00559                 PRINT("ALP_ERR_OFFSET_OVERFLOW\r\n");
00560                 break;
00561             case ALP_ERR_WRITE_OVERFLOW: // 0xF8: Error complete write: Supplied data goes beyond file allocation
00562                 PRINT("ALP_ERR_WRITE_OVERFLOW\r\n");
00563                 break;
00564             case ALP_ERR_WRITE_ERROR: // 0xF7: Error write: impossible to write in storage location
00565                 PRINT("ALP_ERR_WRITE_ERROR\r\n");
00566                 break;
00567             case ALP_ERR_OPERATION_UNKNOWN: // 0xF6: Error unknown Operation
00568                 PRINT("ALP_ERR_OPERATION_UNKNOWN\r\n");
00569                 break;
00570             case ALP_ERR_OPERAND_INCOMPLETE: // 0xF5: Error incomplete Operand
00571                 PRINT("ALP_ERR_OPERAND_INCOMPLETE\r\n");
00572                 break;
00573             case ALP_ERR_OPERAND_WRONG_FORMAT: // 0xF4: Error wrong Operand format
00574                 PRINT("ALP_ERR_OPERAND_WRONG_FORMAT\r\n");
00575                 break;
00576             case ALP_ERR_ITF_INVALID: // 0xF3: Error invalid interface
00577                 PRINT("ALP_ERR_ITF_INVALID\r\n");
00578                 break;
00579             case ALP_ERR_ITF_OVERFLOW: // 0xF2: Error interface overflown (i.e. resources exhausted, buffer full with data discarded)
00580                 PRINT("ALP_ERR_ITF_OVERFLOW\r\n");
00581                 break;
00582             case ALP_ERR_QUERY_FAIL: // 0xF1: (Group of) Query result was false (Informative error code).
00583                 PRINT("ALP_ERR_QUERY_FAIL\r\n");
00584                 break;
00585             case ALP_ERR_ITF_NOT_SPECIFIED:
00586                 PRINT("ALP_ERR_ITF_NOT_SPECIFIED\r\n");
00587                 break;
00588 
00589                 // Other Errors
00590             case ALP_ERR_UNKNOWN: // 0x80: Unknown error
00591                 PRINT("ALP_ERR_UNKNOWN\r\n");
00592                 break;
00593             case ALP_ERR_FS_TIMEOUT: // 0x81: Internal FS Error
00594                 PRINT("ALP_ERR_FS_TIMEOUT\r\n");
00595                 break;
00596             case ALP_ERR_ITF_UNKNOWN: // 0x82: Unknown Interface
00597                 PRINT("ALP_ERR_ITF_UNKNOWN\r\n");
00598                 break;
00599             case ALP_ERR_ITF_TIMEOUT: // 0x83: Internal ITF Error
00600                 PRINT("ALP_ERR_ITF_TIMEOUT\r\n");
00601                 break;
00602             default:
00603                 PRINT("Unknown Error %d\r\n", error);
00604                 break;
00605         }
00606     }
00607 }