Jump to content


  • Content Count

  • Joined

  • Last visited

About JINU

  • Rank
    Noob Class

Contact Methods

  • Website URL

Profile Information

  • Location
  • Interests
    Embedded programming
  1. Hi, In http client demo works fine ,when i POST data in https got 400 error,can any suggest How to POST data in HTTPS. https post method works fine in energia ,but not in CCS ide ,below i added functions in the code int connectToServer(HTTPCli_Handle httpClient) { long retVal=-1; unsigned long g_ulDestinationIp=0; struct sockaddr_in addr; int iAddrSize; if(cur_DestinationIP==0){ retVal=sl_NetAppDnsGetHostByName((signed char *)HOST_NAME, strlen((const char *)HOST_NAME), &cur_DestinationIP, SL_AF_INET); if(retVal<0){ Report("Ip fetch error \n\r"); return -1; } } g_ulDestinationIp=cur_DestinationIP; struct HTTPCli_SecureParams sparams; /* Set secure TLS connection */ /* Security parameters */ sparams.method.secureMethod = SL_SO_SEC_METHOD_SSLV3; sparams.mask.secureMask =SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA256 ; //SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA; strncpy(sparams.cafile, ROOTCA_PEM_FILE, strlen(ROOTCA_PEM_FILE)); sparams.privkey[0] = 0; sparams.cert[0] = 0; sparams.dhkey[0] = 0; HTTPCli_setSecureParams(&sparams); //Report("fetched ip %d \n\r",g_ulDestinationIp); /* Set up the input parameters for HTTP Connection */ addr.sin_family = SL_AF_INET; addr.sin_port = sl_Htons(HOST_PORT); addr.sin_addr.s_addr = sl_Htonl(g_ulDestinationIp); /* Testing HTTPCli open call: handle, address params only */ HTTPCli_construct(httpClient); retVal = HTTPCli_connect(httpClient, (struct sockaddr *)&addr,0, NULL); if (retVal < 0) { Report("Connection failed !\n\r"); return -1; } return 0; } int httpPost(HTTPCli_Handle httpClient,const char * requestURI,char * postData){ char contLength[4]; int postDataLen=strlen(postData); sprintf((char *)contLength, "%d",postDataLen); //sprintf((char *)contLength, "%d",(sizeof(postData)-1)); HTTPCli_Field fields[6]={ {HTTPCli_FIELD_NAME_HOST, HOST_NAME}, {HTTPCli_FIELD_NAME_ACCEPT, "*/*"}, {HTTPCli_FIELD_NAME_CONNECTION,"close"}, {HTTPCli_FIELD_NAME_CONTENT_TYPE, "application/x-www-form-urlencoded"}, //{HTTPCli_FIELD_NAME_CONTENT_LENGTH, contLength}, {NULL, NULL} }; HTTPCli_setRequestFields(httpClient, fields); HTTPCli_sendRequest(httpClient, HTTPCli_METHOD_POST, requestURI, 1); HTTPCli_sendField(httpClient, HTTPCli_FIELD_NAME_CONTENT_LENGTH, (const char *)contLength, 1); int rt=HTTPCli_sendRequestBody(httpClient, postData, postDataLen); return rt; }
  2. in energia 15 it worked //#include <stdlib.h> #include "inc/hw_types.h" #include "inc/hw_wdt.h" #include "driverlib/wdt.h" #include "driverlib/utils.h" #include "driverlib/prcm.h" #include "driverlib/interrupt.h" #include "inc/hw_ints.h" volatile unsigned long g_ulWatchdogCycles = 0; typedef void (*fAPPWDTDevCallbk)(); #define WD_PERIOD_MS 1000 #define SYS_CLK 80000000 #define MILLISECONDS_TO_TICKS(ms) ((SYS_CLK/1000) * (ms)) void WDT_IF_Init(fAPPWDTDevCallbk fpAppWDTCB, unsigned int uiReloadVal); void setup() { boolean bRetcode; Serial.begin(115200); Serial.println("**************************************************"); Serial.println("* CC3200 Watchdog Test *"); Serial.println("**************************************************"); // // Set up the watchdog interrupt handler. // WDT_IF_Init(WatchdogIntHandler, MILLISECONDS_TO_TICKS(WD_PERIOD_MS)); bRetcode = MAP_WatchdogRunning(WDT_BASE); if (!bRetcode) { Serial.println("Watchdog failed to run. Shutting down"); WDT_IF_DeInit(); while (1); } } void loop() { Serial.print("Watchdog interrupt count: "); Serial.println(g_ulWatchdogCycles); delay(1000); } void WatchdogIntHandler(void) { // // After 10 interrupts, switch On LED6 to indicate system reset // and don't clear watchdog interrupt which causes system reset // if (g_ulWatchdogCycles >= 10) { MAP_UtilsDelay(800000); return; } // // Clear the watchdog interrupt. // MAP_WatchdogIntClear(WDT_BASE); // // Increment our interrupt counter. // g_ulWatchdogCycles++; } void WDT_IF_Init(fAPPWDTDevCallbk fpAppWDTCB, unsigned int uiReloadVal) { // // Enable the peripherals used by this example. // MAP_PRCMPeripheralClkEnable(PRCM_WDT, PRCM_RUN_MODE_CLK); // // Unlock to be able to configure the registers // MAP_WatchdogUnlock(WDT_BASE); if (fpAppWDTCB != NULL) { MAP_IntPrioritySet(INT_WDT, INT_PRIORITY_LVL_1); MAP_WatchdogIntRegister(WDT_BASE, fpAppWDTCB); } // // Set the watchdog timer reload value // MAP_WatchdogReloadSet(WDT_BASE, uiReloadVal); // // Start the timer. Once the timer is started, it cannot be disable. // MAP_WatchdogEnable(WDT_BASE); } void WDT_IF_DeInit() { // // Unlock to be able to configure the registers // MAP_WatchdogUnlock(WDT_BASE); // // Disable stalling of the watchdog timer during debug events // MAP_WatchdogStallDisable(WDT_BASE); // // Clear the interrupt // MAP_WatchdogIntClear(WDT_BASE); // // Unregister the interrupt // MAP_WatchdogIntUnregister(WDT_BASE); }
  3. Above code works in energia version 18,but not in energia version 15. in energia 15 i am getting error sketch_oct26a.ino:1:20: fatal error: hw_wdt.h: No such file or directory compilation terminated.
  4. did anyone done watchdog program in energia for cc3200?please attach sample code
  5. Hi sir, multitask serial sample code in energia 17 is not working ,when serial0 changed to serial1.below i added code.please help me . void setup() { Serial1.begin(115200); } void loop() { Serial1.print("Task 1 millis: "); Serial1.println(millis()); delay(1000); } void setup2() { Serial1.begin(115200); } void loop2() { Serial1.print("Task 2 millis: "); Serial1.println(millis()); delay(500); }
  6. multi blink led sample code not running in energia17 ,but in energia 18 it compile successfully ,not worked in cc3200 launchpad. error energia 17 below E:\CC3200 SOFTWARE\energia-0101E0017\tools\common\bin\make --no-print-directory -C C:\Users\jinu\AppData\Local\Temp\build8061049072470418679.tmp\ -f E:\CC3200 SOFTWARE\energia-0101E0017\hardware\common\Makefile E:\CC3200 SOFTWARE\energia-0101E0017\hardware\common\Makefile:19: E:\CC3200: No such file or directory E:\CC3200 SOFTWARE\energia-0101E0017\hardware\common\Makefile:19: SOFTWARE\energia-0101E0017/hardware/cc3200emt/variants/CC3200_LAUNCHXL/Board.mk: No such file or directory CCROOT E:\CC3200 SOFTWARE\energia-0101E0017\hardware\tools\lm4f E:\CC3200 SOFTWARE\energia-0101E0017\hardware\common\Makefile:94: E:\CC3200: No such file or directory SDKROOT E:\CC3200 SOFTWARE\energia-0101E0017\hardware\cc3200emt/CC3200SDK_1.0.0.patch CLOSURE E:\CC3200 SOFTWARE\energia-0101E0017\hardware\common MAINSKETCH MultiBlink.cpp E:\CC3200 SOFTWARE\energia-0101E0017\hardware\common\Makefile:94: SOFTWARE\energia-0101E0017/hardware/cc3200emt/Plat.mk: No such file or directory 'E:\CC3200' is not recognized as an internal or external command, operable program or batch file. make: *** No rule to make target `SOFTWARE\energia-0101E0017/hardware/cc3200emt/Plat.mk'. Stop. E:\CC3200 SOFTWARE\energia-0101E0017\tools\common\bin\make returned 2
  • Create New...