资源简介
用于连接京东云时TCP SSL加密方式连接的开源代码
代码片段和文件信息
/**
* @file date_time.c
* @brief Date and time management
*
* @section License
*
* Copyright (C) 2010-2014 Oryx embedded. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not write to the Free Software Foundation
* Inc. 51 Franklin Street Fifth Floor Boston MA 02110-1301 USA.
*
* @author Oryx embedded (www.oryx-embedded.com)
* @version 1.5.0
**/
//Dependencies
#include
#include
#include “date_time.h“
#if defined(_WIN32)
#include
#endif
//Days
static const char days[8][10] =
{
““
“Monday“
“Tuesday“
“Wednesday“
“Thursday“
“Friday“
“Saturday“
“Sunday“
};
//Months
static const char months[13][10] =
{
““
“January“
“February“
“March“
“April“
“May“
“June“
“July“
“August“
“September“
“October“
“November“
“December“
};
/**
* @brief Format system time
* @param[in] time System time
* @param[out] str NULL-terminated string representing the specified time
* @return Pointer to the formatted string
**/
const char_t *formatSystemTime(systime_t time char_t *str)
{
uint16_t hours;
uint8_t minutes;
uint8_t seconds;
uint16_t milliseconds;
static char_t buffer[24];
//Retrieve milliseconds
milliseconds = time % 1000;
time /= 1000;
//Retrieve seconds
seconds = time % 60;
time /= 60;
//Retrieve minutes
minutes = time % 60;
time /= 60;
//Retrieve hours
hours = time;
//The str parameter is optional
if(!str) str = buffer;
//Format system time
if(hours > 0)
{
sprintf(str “%“ PRIu16 “h %02“ PRIu8 “min %02“ PRIu8 “s %03“ PRIu16 “ms“
hours minutes seconds milliseconds);
}
else if(minutes > 0)
{
sprintf(str “%“ PRIu8 “min %02“ PRIu8 “s %03“ PRIu16 “ms“
minutes seconds milliseconds);
}
else if(seconds > 0)
{
sprintf(str “%“ PRIu8 “s %03“ PRIu16 “ms“ seconds milliseconds);
}
else
{
sprintf(str “%“ PRIu16 “ms“ milliseconds);
}
//Return a pointer to the formatted string
return str;
}
/**
* @brief Format date
* @param[in] date Pointer to a structure representing the date
* @param[out] str NULL-terminated string representing the specified date
* @return Pointer to the formatted string
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-09-16 18:12 CycloneTCP_SSL_Crypto_Open_1_5_0\
目录 0 2014-09-16 18:11 CycloneTCP_SSL_Crypto_Open_1_5_0\common\
文件 2648 2014-09-15 21:51 CycloneTCP_SSL_Crypto_Open_1_5_0\common\compiler_port.h
文件 7219 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\date_time.c
文件 1744 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\date_time.h
文件 1781 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\debug.c
文件 3344 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\debug.h
文件 1559 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\endian.c
文件 7171 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\endian.h
文件 6141 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\error.h
文件 4219 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\fs_port.h
文件 17105 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\fs_port_fatfs.c
文件 4031 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port.h
文件 14162 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_chibios.c
文件 3561 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_chibios.h
文件 13956 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_cmsis_rtos.c
文件 3343 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_cmsis_rtos.h
文件 12388 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_freertos.c
文件 3635 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_freertos.h
文件 14867 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_rtx.c
文件 3785 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_rtx.h
文件 16999 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_ucos3.c
文件 3570 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_ucos3.h
文件 9603 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_windows.c
文件 3287 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\os_port_windows.h
文件 11079 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\path.c
文件 1507 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\path.h
文件 8810 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\resource_manager.c
文件 2847 2014-09-15 21:40 CycloneTCP_SSL_Crypto_Open_1_5_0\common\resource_manager.h
文件 4287 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\str.c
文件 1382 2014-09-10 15:35 CycloneTCP_SSL_Crypto_Open_1_5_0\common\str.h
............此处省略4243个文件信息
相关资源
- TCP/IP详解 第二卷 清晰版 chm
- Kodak Lossless True Color Image Suite
- 西门子S7-1214C与机器人走Modbus Tcp通信
- deo-nano 用户手册
- 《网络安全开发包详解》+ 源代码
- TCI/IP协议详解卷一第二版(中文)含
- 图解TCP/IP(第5版)
- 使用Qt实现客户端服务端聊天和传输文
- 图解TCP/IP pdf版 超清晰 带书签
- 图解TCP_IP_第5版[高清pdf]
- TCP IP详解三卷(kindle可用)
- tcp-ip协议动画演示
- [TCP/IP] TCP/IP 详解 卷2 实现 (英文版)
- TCP_IP_第5版.pdf
- TCPIP 网络编程 韩国 尹圣雨
- 用TCP_IP进行网际互联全集共三卷
- STM32F4x7+freertos+lwip+ssl+MQTT-(MDK5)稳定
- QT tcp 聊天室
- 海思3516A 3516D openssl zlib openssh编译
- Routing TCP.IP Volume I (CCIE Professional D
- STM32F107+LwIP 实现TCP/IP协议栈搭建
- 三菱Q系列PLC---TCP通讯测试程序、soc
- LSP 劫持 TCP协议 UDP协议 HTTP协议 拦
- 收集的各种版本的libeay32.dll+ssleay32.
- Win32OpenSSL-1_0_2c.exe
- Win64OpenSSL-1_0_2d
- 《TCP/IP详解,卷1:协议》RAR完整版
- TCPIP详解_卷1(52im.net独家制作CHM版)
- SecureBlackbox5.1
- x64 windows libcurlopensslzlib编译好,VS直接
评论
共有 条评论