标题:C 语言一些问题
只看楼主
chenalng
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2017-4-27
结帖率:0
已结贴  问题点数:20 回复次数:2 
C 语言一些问题

typedef struct sLoRaMacPrimitives
{
    /*!
     * \brief   MCPS-Confirm primitive
     *
     * \param   [OUT] MCPS-Confirm parameters
     */
    void ( *MacMcpsConfirm )( McpsConfirm_t *McpsConfirm );
    /*!
     * \brief   MCPS-Indication primitive
     *
     * \param   [OUT] MCPS-Indication parameters
     */
    void ( *MacMcpsIndication )( McpsIndication_t *McpsIndication );
    /*!
     * \brief   MLME-Confirm primitive
     *
     * \param   [OUT] MLME-Confirm parameters
     */
    void ( *MacMlmeConfirm )( MlmeConfirm_t *MlmeConfirm );
}LoRaMacPrimitives_t;
static McpsConfirm_t McpsConfirm;
typedef struct sMcpsConfirm
{
    /*!
     * Holds the previously performed MCPS-Request
     */
    Mcps_t McpsRequest;
    /*!
     * Status of the operation
     */
    LoRaMacEventInfoStatus_t Status;
    /*!
     * Uplink datarate
     */
    uint8_t Datarate;
    /*!
     * Transmission power
     */
    int8_t TxPower;
    /*!
     * Set if an acknowledgement was received
     */
    bool AckReceived;
    /*!
     * Provides the number of retransmissions
     */
    uint8_t NbRetries;
    /*!
     * The transmission time on air of the frame
     */
    TimerTime_t TxTimeOnAir;
    /*!
     * The uplink counter value related to the frame
     */
    uint32_t UpLinkCounter;
    /*!
     * The uplink frequency related to the frame
     */
    uint32_t UpLinkFrequency;
}McpsConfirm_t;





int main( void )
{

        
          LoRaMacPrimitives_t LoRaMacPrimitives;
    LoRaMacCallback_t LoRaMacCallbacks;
    MibRequestConfirm_t mibReq;

    BoardInitMcu( );
    BoardInitPeriph( );

    DeviceState = DEVICE_STATE_INIT;
        

        


    while( 1 )
    {
        switch( DeviceState )
        {
            case DEVICE_STATE_INIT:
            {
                LoRaMacPrimitives.MacMcpsConfirm = McpsConfirm;
                LoRaMacPrimitives.MacMcpsIndication = McpsIndication;
                LoRaMacPrimitives.MacMlmeConfirm = MlmeConfirm;
此处省略了 太长了就复制关键部分;
这个赋值没有看懂,LoRaMacPrimitives 我觉得一个函数指针的结构体 MacMcpsConfirm 这个函数指针的参数是 McpsConfirm_t *McpsConfirm,但是赋值的时候怎么就把 参数结构体 赋值过去了
这个做法没有看懂
搜索更多相关主题的帖子: parameters void the frame 赋值 
2017-04-27 10:23
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:432
帖 子:10064
专家分:41463
注 册:2014-5-20
得分:10 
LoRaMacPrimitives.MacMcpsConfirm = McpsConfirm;
编译能通过吗?
2017-04-27 11:06
kelehaier
Rank: 2
等 级:论坛游民
帖 子:12
专家分:39
注 册:2011-11-13
得分:10 
这是从哪里复制过来的

学习C语言,请关注微博与微信:C语言编程技术分享
2017-04-29 10:20



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-476478-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.161995 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved