Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add curl option #13

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Commits on Aug 4, 2024

  1. Put class declaration into header file.

    Also change the DRIVER_MODIFICATION number even though I'm not sure if
    this should be done since this shouldn't change anything in the driver
    per se.
    marcofilho committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    76d2f02 View commit details
    Browse the repository at this point in the history
  2. Style: remove invisible ^L characters

    marcofilho committed Aug 4, 2024
    Configuration menu
    Copy the full SHA
    44d4952 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2024

  1. Add curl compilation and runtime option

    Add WITH_CURL compilation option.
    
    If compiled with WITH_CURL = YES, CurlUsage.template file will be added
    and it's records will be created. curl.h will be included.
    First record - UseCurl - should futurely toggle curl usage in the
    Driver.
    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    73fbdce View commit details
    Browse the repository at this point in the history
  2. Add curl initialization option.

    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    e11a8bf View commit details
    Browse the repository at this point in the history
  3. Add record to set CURLOPT_HTTPAUTH

    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    377795a View commit details
    Browse the repository at this point in the history
  4. Add record to set CURLOPT_SSL_VERIFYHOST

    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    39d9b34 View commit details
    Browse the repository at this point in the history
  5. Add record for setting CURLOPT_SSL_VERIFYPEER

    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    702fc78 View commit details
    Browse the repository at this point in the history
  6. Get rid of unnecessary itemp variable.

    No need to use getIntegerParam in this context if we already have the
    value argument.
    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    308d666 View commit details
    Browse the repository at this point in the history
  7. Add record to set CURLOPT_USERNAME (beware)

    Using this along with to-be-added CURLOPT_PASSWORD would expose
    credentials in the network.
    
    I leave it in the driver as a means to completely express the API
    functionalities, but there should be better ways of setting your
    credentials if you mean to.
    
    Probably will add a configuration file for that in the future.
    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    2906040 View commit details
    Browse the repository at this point in the history
  8. Add record for setting CURLOPT_PASSWORD (beware)

    Same warning about last commit: this shouldn't be used but it's left
    here as an option for quick testing and better expressing the API
    functionalities.
    
    For actual credentials usage future records should add a path for a
    configuration file containing the credentials.
    marcofilho committed Aug 7, 2024
    Configuration menu
    Copy the full SHA
    0176dc2 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2024

  1. Add records to set config filepath

    Should be used to load the file contents and put them
    into the correct parameters. Uses a very similar mechanism from
    NDFile.template and functions from asynNDArrayDriver.
    
    For now it just checks if the file exists and is accessible, but not
    it's contents.
    marcofilho committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    78d9c2c View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2024

  1. Add curl file loading functionality

    Add CurlLoadConfig record and loadConfigFile function.
    
    loadConfigFile() calls writeInt32 and writeOctet for all parameters
    it can recognize, except username and password. For those,
    loadConfigFile() calls curl_easy_setopt without ever setting the
    parameter value.
    
    This means setpoint and RBV values for all parameters can be different,
    so I add readback values for all records.
    
    writeInt32 and writeOctet are called inside loadConfigFile(), which is
    called inside writeInt32. In my understanding this cannot lead to any
    infinite loop since CurlLoadConfig record has no "ASYN_" prepending it's
    name, so it's impossible for it to call writeInt32 on itself.
    
    Also, I think this is thread safe because the function is only supposed
    to be called inside writeInt32, which is supposed to be already locked.
    marcofilho committed Aug 18, 2024
    Configuration menu
    Copy the full SHA
    b9ca193 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2024

  1. Add writeCallback and buffer. Use it on readImage.

    Readbuffer is a char vector just so we can copy all needed bytes to it.
    writeCallback should simply add stuff to the buffer.
    
    readImage clears buffer before adding to it. Unfortunately I think clear
    cant be called inside writeCallback because it's called more than one
    time per read.
    marcofilho committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    116434e View commit details
    Browse the repository at this point in the history
  2. Fix: add needed set of CURLOPT_URL

    This is obviously needed and acquisition will fail without this.
    marcofilho committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    404f5dc View commit details
    Browse the repository at this point in the history
  3. Style: remove trailing whitespaces.

    marcofilho committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    8cff152 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'add-config-file' into add-curl-option

    marcofilho committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    d11dec2 View commit details
    Browse the repository at this point in the history
  5. Add WITH_CURL example in CONFIG_SITE

    WITH_CURL = YES/NO is used to tell the compiler to use or not use curl.
    I add an example in configure/CONFIG_SITE to make it easy for people to
    enable/disable this in future.
    marcofilho committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    de4f1ad View commit details
    Browse the repository at this point in the history
  6. Merge branch 'add-curl-option'

    Curl is added as an option both at compile and at runtime.
    
    If compiled with WITH_CURL = YES at configure/CONFIG_SITE.local,
    curl option will be enabled at runtime but default will still be UseCurl
    = NO.
    
    If record $(P)$(R)UseCurl = YES, then code will get image from URL using
    libCurl instead of graphicsMagick. Some curlOptions are configurable as
    records. More can be easily added.
    
    The CurlConfigFile.template is based on NDFile.template, but a bit
    different, so I preferred to create a new one instead of including the
    one that already exists. Maybe this can be modified in future.
    marcofilho committed Aug 21, 2024
    Configuration menu
    Copy the full SHA
    32681b4 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2024

  1. Add driver description in ADURL.rst

    Describe all new records along with brief driver description.
    marcofilho committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    b55dc74 View commit details
    Browse the repository at this point in the history
  2. Add comments in st_base example file

    Comments to make it easier to load Curl template file if compiled with
    WITH_CURL=YES
    marcofilho committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    1208fb1 View commit details
    Browse the repository at this point in the history
  3. Add comments in code

    marcofilho committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    2aec6fd View commit details
    Browse the repository at this point in the history
  4. Merge branch 'documentation' into add-curl-option

    marcofilho committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    01698b2 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'add-curl-option'

    Add records and driver description into ADURL.rst and code comments in
    each function.
    marcofilho committed Aug 22, 2024
    Configuration menu
    Copy the full SHA
    1b1c03f View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2024

  1. Change driver modification/revision numbers

    Since this PR is supposed to add new functionality, I reset patch number
    and add to revision number.
    marcofilho committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    dbe0454 View commit details
    Browse the repository at this point in the history
  2. Update RELEASE with curl modifications

    Update with info about header file change and curl functionality added.
    marcofilho committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    af80cc7 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'doc' into add-curl-option

    marcofilho committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    992a83d View commit details
    Browse the repository at this point in the history
  4. Merge branch 'add-curl-option'

    Post merge of doc branch into add-curl-option.
    marcofilho committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    74aa1a6 View commit details
    Browse the repository at this point in the history