Common interface for plain old vanilla microframework and gadgeteer module.

Developer
Feb 24, 2013 at 9:03 PM
Hi in order to be able to use the same core functionality from plain vanilla mf and gadgeteer i've created a common interface
using System;
using Microsoft.SPOT;

namespace Gralin.NETMF.Nordic
{
    /// <summary>
    /// NRF24L01Plus Interface 
    /// 
    /// This interface is shared from the NRF24L01Plus engine and the Gadgeteer Module
    /// So upper layer classes can use both indifferently
    /// </summary>
    public interface INRF24L01Plus
    {
        /// <summary>
        /// Interface is Enabled?
        /// </summary>
        bool IsEnabled { get; }

        /// <summary>
        ///   Disables the module
        /// </summary>
        void Disable();

        /// <summary>
        ///   Enables the module
        /// </summary>
        void Enable();

        /// <summary>
        /// Configure the module basic settings. Module needs to be initiaized.
        /// </summary>
        /// <param name="address">RF address (3-5 bytes). The width of this address determins the width of all addresses used for sending/receiving.</param>
        /// <param name="channel">RF channel (0-127)</param>
        void Configure(byte[] address, byte channel);

        /// <summary>
        /// Set one of 6 available module addresses
        /// </summary>
        void SetAddress(AddressSlot slot, byte[] address);

        /// <summary>
        /// Read 1 of 6 available module addresses
        /// </summary>
        byte[] GetAddress(AddressSlot slot, int width);

        /// <summary>
        ///   Gets module basic status information
        /// </summary>
        Status GetStatus();

        /// <summary>
        ///   Reads the current rf channel value set in module
        /// </summary>
        /// <returns></returns>
        byte GetChannel();

        /// <summary>
        ///   Gets the module radio frequency [MHz]
        /// </summary>
        /// <returns>Frequency in MHz</returns>
        int GetFrequency();

        /// <summary>
        ///   Sets the rf channel value used by all data pipes
        /// </summary>
        /// <param name="channel">7 bit channel value</param>
        void SetChannel(byte channel);

        /// <summary>
        ///   Send <param name = "bytes">bytes</param> to given <param name = "address">address</param>
        ///   This is a non blocking method.
        /// </summary>
        void SendTo(byte[] address, byte[] bytes);
                
        /// <summary>
        ///   Sends <param name = "bytes">bytes</param> to given <param name = "address">address</param>
        ///   This is a blocking method that returns true if data was received by the recipient or false if timeout occured.
        /// </summary>
        bool SendTo(byte[] address, byte[] bytes, int timeout);

        /// <summary>
        ///   Occurs when data packet has been received
        /// </summary>
        event Gralin.NETMF.Nordic.NRF24L01Plus.OnDataRecievedHandler OnDataReceived;

        /// <summary>
        ///   Occurs when ack has been received for send packet
        /// </summary>
        event Gralin.NETMF.Nordic.NRF24L01Plus.EventHandler OnTransmitSuccess;

        /// <summary>
        ///   Occurs when no ack has been received for send packet
        /// </summary>
        event Gralin.NETMF.Nordic.NRF24L01Plus.EventHandler OnTransmitFailed;
    }
}
Then, i've created the gadgeteer module even for 4.2 framework.

If this project will not be updated... i will open another one with this source code if it is ok.
Aug 6, 2013 at 6:09 AM
SandeX, I'm attempting to get this project updated. Can you share your changes? We can post a patch to the project when its all working as expected.
Coordinator
Aug 6, 2013 at 8:17 AM
Hi, If you create a patch i will review it and add it to the repo if it looks ok. Please include description what you are changing why and was it tested.
Developer
Aug 6, 2013 at 10:00 AM

Hi

Unfortunately im on holiday ill send you the patch the next week. Ok?

Il giorno 06/ago/2013 09:17, "gralinPL" <[email removed]> ha scritto:

From: gralinPL

Hi, If you create a patch i will review it and add it to the repo if it looks ok. Please include description what you are changing why and was it tested.

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Aug 6, 2013 at 10:40 AM
Sure no problem. Just submit it thru Codeplex
Developer
Aug 12, 2013 at 1:15 PM
Hi,

unfortunately i can give you just my code.

Take into account that i've added just the INRF24L01Plus interface and this interface is now implmented by some classes.

I've recreated from scratch the Gadgeteer module project G2Tech.nRF24L01Plus

So no way to create a patch.

Just keep as example... this would be very nice to be present in your trunk! In this way i can modularize better the "client code".

I sent you even some code of my "shared context" library.... it's a project i'm doing... when i've time... that under the hood would use your library for the comunication but it's open to any type of channel, implemeting some interfaces...

The idea is to use the spanning tree approach to create an unique path between a set of microframework devices.... connected in network in order to share a list of set points.


Regards


2013/8/6 gralinPL <[email removed]>

From: gralinPL

Sure no problem. Just submit it thru Codeplex

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Aug 13, 2013 at 6:57 PM
SandeX, the interface is handy, of course. So, did you have to do anything special to get the Gadgeteer module working on v4.2? I simply compiled the project as v4.2 but have not tested it yet.